Elixir v1.20 introduces the first milestone of its set-theoretic gradual type system, enabling type inference and type checking across every Elixir program without requiring type annotations. The release centers on the dynamic() type, which behaves as a range that narrows as it flows through code, reporting only verified bugs — typing violations guaranteed to fail at runtime — while keeping false positives extremely low. Key features include type narrowing across guards, case clauses, and conditionals, plus typed standard library functions for tuples and maps. The release also improves compilation speed, now benchmarking as the fastest build tool among BEAM languages, and introduces a new :module_definition compiler option. Future work includes recursive types, parametric types, and eventually user-supplied type signatures.

9m read timeFrom elixir-lang.org
Post cover image
Table of contents
Types, in my Elixir?The dynamic() typeTyping guards, clauses, and moreCompilation time improvementsWhat is next?
2.9K Impressions