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


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>This old thread could be a useful read <a href="http://erlang.org/pipermail/erlang-questions/2008-October/thread.html#39245" class="inline-onebox" rel="nofollow">The erlang-questions October 2008 Archive by thread</a>.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="189565" 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/42">Post #41</a>
	                </div>
	            </div>
              <div id="likers-container-189565" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="189565"
                     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 #41"></div>
  </section>
</div>
    <div class="postbit" id="219847" data-post-id="219847">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I know I’m coming back here after a long time, but the idea has stuck.</p>
<p><a class="mention" href="/u/ityonemo" rel="nofollow">@ityonemo</a> could you elaborate on this idea?</p>
<p>I was using typescript as a reference implementation because it seems to have similar constraints. Typescript is a layer on top of Javascript, is structurally typed (like Elixir), has amazing editor &amp; code completion support, and deals with a language underneath that is dynamically typed.</p>
<p>Imagining a world where we throw away dialyzer specs and replace them with a type system layer similar to Typescript.</p>
<p>Actually I think the could would be simpler than Typescript because Elixir is a simpler language.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="219847" 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/43">Post #42</a>
	                </div>
	            </div>
              <div id="likers-container-219847" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="219847"
                     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 #42"></div>
  </section>
</div>
    <div class="postbit" id="219880" data-post-id="219880">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>yeah, I’m bullish on a “much better dialyzer”.  I did just clear two things off of my stack, so one more to get to before continuing work on my type system.  The state i’m at is that I have taken more of a “scientist’s approach” instead of a “mathematician’s approach”.  What this means is instead of trying to shoehorn erlang VM into an existing theoretical typesystem, start from a theory of how the VM works, and build a typesystem around it using basic math, and set theory.  I’ll be picking up my work on Mavis and Selectrix soon!</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="219880" 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/44">Post #43</a>
	                </div>
	            </div>
              <div id="likers-container-219880" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="219880"
                     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 #43"></div>
  </section>
</div>
    <div class="postbit" id="220257" data-post-id="220257">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Excellent! I think it could also be a useful exercise to brainstorm developer experience. But suppose that’s a separate challenge?</p>
<p>One idea would be to see how a subset of typescript might map to elixir. For example the following are not exactly the same, but have equivalents in Elixir</p>
<ul>
<li>Interfaces</li>
<li>Union types</li>
<li>Guard clauses</li>
</ul>
<p>Another thing worth looking at is JSDoc because it allows documenting types separately in the same way typespecs do.</p>
<p>Both will certainly have drawbacks but I think we may learn something from them.</p>
<p>Something inspired by interfaces and union types could cover quite a large amount of what Elixir typespecs do.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="220257" 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/45">Post #44</a>
	                </div>
	            </div>
              <div id="likers-container-220257" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="220257"
                     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 #44"></div>
  </section>
</div>
    <div class="postbit" id="220258" data-post-id="220258">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Types:</p><aside class="onebox allowlistedgeneric" data-onebox-src="https://mavis.hexdocs.pm/Type.html">
  <header class="source">

      <a href="https://mavis.hexdocs.pm/Type.html" target="_blank" rel="noopener nofollow ugc">mavis.hexdocs.pm</a>
  </header>

  <article class="onebox-body">
    

<h3><a href="https://mavis.hexdocs.pm/Type.html" target="_blank" rel="noopener nofollow ugc">Type — mavis v0.0.6</a></h3>



  </article>

  <div class="onebox-metadata">
    
    
  </div>

  <div style="clear: both"></div>
</aside>

<p>I’m in the middle of refactoring this.  I realized I was doing lists and functions wrong.</p>
<p>inference:<br>
<a href="https://github.com/ityonemo/mavis_inference/" class="onebox" target="_blank" rel="noopener nofollow ugc">https://github.com/ityonemo/mavis_inference/</a></p>
<p>Implements a DSL e.g. (<a href="https://github.com/ityonemo/mavis_inference/blob/main/lib/type.inference/opcodes/bifs.ex" class="inline-onebox" rel="noopener nofollow ugc">mavis_inference/lib/type.inference/opcodes/bifs.ex at main · ityonemo/mavis_inference · GitHub</a>) that lets you define what types are accepted and rejected in both directions across an opcode, so you can do a bidirectional sift and infer which types are usable and which types are rejected.</p>
<p>There’s still some bugs and I need to write a sanity check to make sure that if you backpropagate, the type union is strictly smaller than the forward pass (because right now it’s infinite-looping on quite a bit of code).</p>
<p>Anyways if this stuff is interesting to you, i’m happy to accept help!</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="220258" data-batch-url="/posts/batch_likers">
                        2
                      </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/46">Post #45</a>
	                </div>
	            </div>
              <div id="likers-container-220258" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="220258"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-last-post cat-last-post" title="Last post!"></div>
  </section>
</div>
</template></turbo-stream><turbo-stream action="replace" target="load-more-container"><template><div id="load-more-container" class="load-more-container">
    <span class="all-loaded">— All posts loaded —</span>
</div></template></turbo-stream>