<turbo-stream action="append" target="posts_list"><template>    <div class="postbit" id="152938" data-post-id="152938">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="Fl4m3Ph03n1x" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/Fl4m3Ph03n1x/120/11709_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  Fl4m3Ph03n1x
                      <span class="op-star" title="Thread Starter">
                        <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                      </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p><a class="mention" href="/u/lpil" rel="nofollow">@lpil</a> Very interesting! But wouldn’t it be easier to create a tool for gradual typing instead of creating your own entire language? I am just curious!</p>
<p><a class="mention" href="/u/chrismcg" rel="nofollow">@chrismcg</a>  I saw the video, thanks for sharing!<br>
It turns out that they started working on a type system! (yeey)<br>
And then they stopped …  (ohhh)</p>
<p>At least they explored some alternatives, which is always good!</p>
<hr>
<p>Thank you everyone for your kind feedback!<br>
I have learned quite a lot here and I feel better for it.</p>
<p>I take it that the main reason no one is adding a typing system to Elixir now, is because of ROI and that the ecosystem currently doesn’t have enough resources to devote to this challenge.</p>
<p>Additional, it is also very interesting to have the historical reason on why erlang didn’t have strong static typing (thanks to <a class="mention" href="/u/rvirding" rel="nofollow">@rvirding</a> ).</p>
<p>I guess static strong typing is a lot more complex than I initially thought !</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="152938" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/how-hard-would-it-be-to-have-a-static-typing-system-in-elixir/27192/22">Post #21</a>
	                </div>
	            </div>
              <div id="likers-container-152938" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="152938"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #21"></div>
  </section>
</div>
    <div class="postbit" id="152949" data-post-id="152949">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="lpil" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/lpil/120/17492_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  lpil
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Creator of Gleam</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="Fl4m3Ph03n1x" data-post="22" data-topic="27192">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/fl4m3ph03n1x/48/11709_2.png" class="avatar"> Fl4m3Ph03n1x:</div>
<blockquote>
<p>But wouldn’t it be easier to create a tool for gradual typing instead of creating your own entire language?</p>
</blockquote>
</aside>
<p>I think the gap isn’t as big as you might think. To add a type system to an existing language it needs to be gradually typed and carefully tailored to the semantics of the existing language, while if you create a new language you can design the semantics and the type system at the same time so they complement each other well.</p>
<p>The end result is somewhat different too. With a gradually typed language you need to add type annotations to the entire program in order to get full type safety, while with more conventional Hindley Milner type systems no annotations are required at all and you always get total safety.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="152949" data-batch-url="/posts/batch_likers">
                        8
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/how-hard-would-it-be-to-have-a-static-typing-system-in-elixir/27192/23">Post #22</a>
	                </div>
	            </div>
              <div id="likers-container-152949" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="152949"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #22"></div>
  </section>
</div>
    <div class="postbit" id="153060" data-post-id="153060">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="rvirding" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/rvirding/120/1409_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  rvirding
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Creator of Erlang</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="Fl4m3Ph03n1x" data-post="22" data-topic="27192" data-full="true">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/fl4m3ph03n1x/48/11709_2.png" class="avatar"> Fl4m3Ph03n1x:</div>
<blockquote>
<p>Additional, it is also very interesting to have the historical reason on why erlang didn’t have strong static typing (thanks to <a class="mention" href="/u/rvirding" rel="nofollow">@rvirding</a> ).</p>
<p>I guess static strong typing is a lot more complex than I initially thought !</p>
</blockquote>
</aside>
<p>I wouldn’t say the implementation is that much more complex, the complex bit is making the choices. It always a trade-off: if I do it this then I will get XXX but I will lose YYY, which is best for our needs. For example ending up a functional language, or having non-sharing processes, or being dynamically typed.</p>
<p>TANSTAAFL</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="153060" data-batch-url="/posts/batch_likers">
                        6
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/how-hard-would-it-be-to-have-a-static-typing-system-in-elixir/27192/24">Post #23</a>
	                </div>
	            </div>
              <div id="likers-container-153060" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="153060"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #23"></div>
  </section>
</div>
    <div class="postbit" id="153294" data-post-id="153294">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="OvermindDL1" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/OvermindDL1/120/2677_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  OvermindDL1
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="Phillipp" data-post="2" data-topic="27192">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/phillipp/48/10625_2.png" class="avatar"> Phillipp:</div>
<blockquote>
<p>even if that will practically never happen</p>
</blockquote>
</aside>
<p>‘practically’  ^.^;</p>
<aside class="quote no-group" data-username="kokolegorille" data-post="4" data-topic="27192">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/kokolegorille/48/4784_2.png" class="avatar"> kokolegorille:</div>
<blockquote>
<p>Typing datatype in Elixir is fine, but what is the type of an Exit signal? or any messages between processes?</p>
</blockquote>
</aside>
<p>Exit signal would be an expandable variant type.</p>
<p>Messages between processes should be black boxed, that’s the only logical way to do it, lol.  ^.^</p>
<aside class="quote no-group" data-username="lpil" data-post="5" data-topic="27192">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/lpil/48/17492_2.png" class="avatar"> lpil:</div>
<blockquote>
<p>Personally it’s not a trade off I enjoy, which I why I’ve been making <a href="https://github.com/gleam-lang/gleam" rel="noopener nofollow ugc">Gleam </a>, a statically typed language for the BEAM.</p>
</blockquote>
</aside>
<p>Gleam is looking awesome, people should look at it!</p>
<aside class="quote no-group" data-username="peerreynders" data-post="9" data-topic="27192">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/peerreynders/48/5826_2.png" class="avatar"> peerreynders:</div>
<blockquote>
<p>But given that interprocess communication is typically about protocols there is a <em>temporal</em> aspect that static typing can’t cover. A perfectly “well formed” message in the mailbox about to be pulled out can still be “invalid” with respect to the current <em>runtime</em> state of the process.</p>
</blockquote>
</aside>
<p>Black boxed type!  ^.^</p>
<aside class="quote no-group" data-username="peerreynders" data-post="9" data-topic="27192">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/peerreynders/48/5826_2.png" class="avatar"> peerreynders:</div>
<blockquote>
<ol>
<li>You can only type the messages you expect to receive.</li>
<li>It also implies that you cannot put a stop to an unexpected message from being sent to you.</li>
</ol>
</blockquote>
</aside>
<p>Of course.  In 1 you can only handle things you know about anyway, it’s like receiving JSON, you have to validate it and handle when that fails.  In 2 of course, that’s how the beam works, you need to handle the unhandled message case, just like you do in Elixir now.  It’s a standard boundary problem, which like with JSON means you need to parse it out somehow, which a decomposable blackbox’d type can do.</p>
<aside class="quote no-group" data-username="ityonemo" data-post="10" data-topic="27192">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/ityonemo/48/11341_2.png" class="avatar"> ityonemo:</div>
<blockquote>
<p>How would you handle this situation with static types?</p>
</blockquote>
</aside>
<p>Same as you do now, match on what you can, handle in a fallback (log a message?) what you can’t.</p>
<aside class="quote no-group" data-username="ityonemo" data-post="10" data-topic="27192">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/ityonemo/48/11341_2.png" class="avatar"> ityonemo:</div>
<blockquote>
<p>it’s “done” in golang (gRPC)</p>
</blockquote>
</aside>
<p>Golang is very <em>very</em> verbose as a language, something built on the BEAM, like potentially gleam, can do far better.</p>
<aside class="quote no-group" data-username="lpil" data-post="11" data-topic="27192">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/lpil/48/17492_2.png" class="avatar"> lpil:</div>
<blockquote>
<p>For static types to work (without dependant typing) the types can never be changed at runtime, this limitation is unavoidable.</p>
</blockquote>
</aside>
<p>You only need to verify what stays within the typed side.  For things coming out either blackbox it and verify if you want to handle fallback, or just “let it crash”, as most erlang/elixir functions do when handed wrong data already.</p>
<aside class="quote no-group" data-username="lpil" data-post="11" data-topic="27192">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/lpil/48/17492_2.png" class="avatar"> lpil:</div>
<blockquote>
<p>Oh yes definitely! A type system does nothing at runtime to protect you from code that doesn’t adhere to the contract it enforces. This could happen when being sent messages from untyped code (i.e. written in Elixir or Erlang without type checking), or when there is a bug in your types.</p>
</blockquote>
</aside>
<p>Well it could program in guards, but those can potentially be quite slow (validating a list is only integers for example).  ^.^;</p>
<aside class="quote group-Erlang-Core-Team" data-username="rvirding" data-post="13" data-topic="27192">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/rvirding/48/1409_2.png" class="avatar"> rvirding:</div>
<blockquote>
<p>On a side note I would say probably the main difficulty with implementing a statically typed language on top of erlang/OTP/BEAM is interfacing to the world outside. I mean you can call any function with any arguments and send any message to any process so the problem how do I make the statically typed part of the system “safe”. And no, processes can’t hide either as with the Process.list/processes built-in functions I can see all processes.</p>
</blockquote>
</aside>
<p>I think the pattern of the BEAM already can still hold in a typed language on top, crash with invalid data, parse external data to something useful internally, etc…  <img src="https://forum.elixirforum.com/images/emoji/apple/slight_smile.png?v=15" title=":slight_smile:" class="emoji" alt=":slight_smile:" loading="lazy" width="20" height="20"></p>
<aside class="quote group-Erlang-Core-Team" data-username="rvirding" data-post="13" data-topic="27192">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/rvirding/48/1409_2.png" class="avatar"> rvirding:</div>
<blockquote>
<p>A final note: Erlang/elixir/BEAM is actually strongly typed but dynamically typed not statically typed. If we want to be picky.</p>
</blockquote>
</aside>
<p>Yep yep, I was waiting for this to pop up, the thread OP meant static typing, not strong typing.  ^.^</p>
<aside class="quote group-Erlang-Core-Team" data-username="rvirding" data-post="17" data-topic="27192">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/rvirding/48/1409_2.png" class="avatar"> rvirding:</div>
<blockquote>
<p>Wouldn’t that become rather heavy if it is checking for every request. How does it reload the the recompiled modules? Is it just loading them in or is it using some mechanism like OTPs <code>code_change</code> callback to allow old version to “migrate” to new version?</p>
</blockquote>
</aside>
<p>Phoenix_live_reload is a dev only tool, it watches the filesystem for changes and recompiled and hot-loads changes.  You wouldn’t run it at release time.</p>
<p>Now for the bit I was waiting for someone to mention but it doesn’t look like anyone did.  Don’t forget that the <a href="https://github.com/josefs/Gradualizer" rel="noopener nofollow ugc"><code>Gradualizer</code></a> Static Typer for the BEAM is in progress.  Still has some work left but it can strongly type most code already.  It has revealed that a lot of typespecs in Elixir are just outright wrong (and some in erlang though not as many).  ^.^</p>
<p>It has the ability to override types though so you can ‘fix’ them up without editing their source.</p>
<p>And yes, I have a <a href="https://github.com/OvermindDL1/gradualixir" rel="noopener nofollow ugc"><code>Gradualixir</code></a> library that wraps it for ease of running as a mix task, though do not that Gradualixir is in heavy flux so if it doesn’t compile then please send a PR or at least an issue with the error and a reproducible file (or ignore that if it happens on all) to me.  ^.^</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="153294" data-batch-url="/posts/batch_likers">
                        3
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/how-hard-would-it-be-to-have-a-static-typing-system-in-elixir/27192/25">Post #24</a>
	                </div>
	            </div>
              <div id="likers-container-153294" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="153294"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #24"></div>
  </section>
</div>
    <div class="postbit" id="153431" data-post-id="153431">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="msz" src="/assets/icons/user-9f439610.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  msz
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>If what you want is stricter build time guarantees that your functions actually implement the typespecs in <code>@spec</code>s or <code>@callback</code>s, you might find my library <a href="https://github.com/msz/hammox" rel="noopener nofollow ugc">Hammox</a> very useful. It contains its own strict type-value checker and you can set it up to automatically check that function calls you do in tests match the defined typespecs.</p>
<p>It’s especially useful when using mocks — you want to ensure that the mock actually implements the same type signature as your real function. <a href="https://github.com/msz/hammox" rel="noopener nofollow ugc">Hammox</a> is actually an enhanced version of José <a href="https://github.com/plataformatec/mox" rel="noopener nofollow ugc">Mox</a> (and the Mox readme now links to it too). You set up behaviour based mocks and all calls to them are automatically type checked.</p>
<p>For me it has dramatically decreased my needs for strong static type checking because I find that dynamic type checking like this, when done rigorously, can be almost as good as static. It also encourages you to actually test all code you write so it’s a win-win!</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="153431" data-batch-url="/posts/batch_likers">
                        6
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/how-hard-would-it-be-to-have-a-static-typing-system-in-elixir/27192/26">Post #25</a>
	                </div>
	            </div>
              <div id="likers-container-153431" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="153431"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #25"></div>
  </section>
</div>
    <div class="postbit" id="172898" data-post-id="172898">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="fireproofsocks" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/fireproofsocks/120/7669_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  fireproofsocks
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote group-Erlang-Core-Team" data-username="rvirding" data-post="13" data-topic="27192">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/rvirding/48/1409_2.png" class="avatar"> rvirding:</div>
<blockquote>
<p>absolute requirement</p>
</blockquote>
</aside>
<p>Forgive my ignorance, but I’m very curious (I do not have a background in compiled languages and only a basic understanding of dynamic code upgrades). Is the takeaway here that having a statically typed language would have made dynamic code upgrades impossible because you can’t have one version of the code that statically pegs a variable to a specific type while another version of the code pegs it to a different type?  Would static typing end up pointing to different regions of memory?  Whereas dynamic typing would allow for “run-time” resolution of the variable values in memory?</p>
<p>Thanks for sharing your wisdom/experience!</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="172898" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/how-hard-would-it-be-to-have-a-static-typing-system-in-elixir/27192/27">Post #26</a>
	                </div>
	            </div>
              <div id="likers-container-172898" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="172898"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #26"></div>
  </section>
</div>
    <div class="postbit" id="172936" data-post-id="172936">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="rvirding" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/rvirding/120/1409_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  rvirding
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Creator of Erlang</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Yes, sort of though not so much variables but functions and function interfaces. I might change an exported function so that it not only returns 3 element tuples like it did before but now also 4 element tuples. For this to work in a statically typed system I would have to find, modify and re-type all functions which are dependent on those return values. The dynamic typing may result in some calls crashing but the others will still work.</p>
<p>It is the difference between being able to manage modules as units and it being necessary to potentially manage the whole system as a unit.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="172936" data-batch-url="/posts/batch_likers">
                        4
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/how-hard-would-it-be-to-have-a-static-typing-system-in-elixir/27192/28">Post #27</a>
	                </div>
	            </div>
              <div id="likers-container-172936" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="172936"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #27"></div>
  </section>
</div>
    <div class="postbit" id="172968" data-post-id="172968">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="fireproofsocks" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/fireproofsocks/120/7669_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  fireproofsocks
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>That’s brilliant, and that makes total sense.  Thank you for the response!</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="172968" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/how-hard-would-it-be-to-have-a-static-typing-system-in-elixir/27192/29">Post #28</a>
	                </div>
	            </div>
              <div id="likers-container-172968" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="172968"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #28"></div>
  </section>
</div>
    <div class="postbit" id="178434" data-post-id="178434">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="OvermindDL1" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/OvermindDL1/120/2677_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  OvermindDL1
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote group-Erlang-Core-Team" data-username="rvirding" data-post="28" data-topic="27192">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/rvirding/48/1409_2.png" class="avatar"> rvirding:</div>
<blockquote>
<p>Yes, sort of though not so much variables but functions and function interfaces. I might change an exported function so that it not only returns 3 element tuples like it did before but now also 4 element tuples. For this to work in a statically typed system I would have to find, modify and re-type all functions which are dependent on those return values. The dynamic typing may result in some calls crashing but the others will still work.</p>
</blockquote>
</aside>
<p>The static typing preventing the compile prevents those occasional calls crashing though, even if others would work.</p>
<p>If you added the new field of the tuple anyway onto the ‘end’ then it wouldn’t crash in almost any language I see with static tuples though, now in the middle on the other hand…  Lol.</p>
<p>Though at that size you probably want named fields via a record, which still compiles like a tuple internally.  ^.^</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="178434" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/how-hard-would-it-be-to-have-a-static-typing-system-in-elixir/27192/30">Post #29</a>
	                </div>
	            </div>
              <div id="likers-container-178434" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="178434"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #29"></div>
  </section>
</div>
    <div class="postbit" id="178468" data-post-id="178468">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="Exadra37" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/Exadra37/120/9183_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  Exadra37
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>One thing that I really miss in Elixir is not be able to declare the types for each struct field, like we can do in GoLang.</p>
<p>Any technical reason for not having this implemented in Elixir/Erlang land?</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="178468" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/how-hard-would-it-be-to-have-a-static-typing-system-in-elixir/27192/31">Post #30</a>
	                </div>
	            </div>
              <div id="likers-container-178468" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="178468"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #30"></div>
  </section>
</div>
</template></turbo-stream><turbo-stream action="replace" target="load-more-container"><template><div id="load-more-container" class="load-more-container">
    <a class="load-more-button" data-turbo-stream="true" href="/topics/27192/load_more?page=4">Load more posts</a>
</div></template></turbo-stream>