P
Back to articles
News4 min read

Elixir v1.20 is now a gradually typed language

Elixir v1.20 introduces gradual typing with set-theoretic types (union, intersection, negation), developed over several years by the Elixir core team led by José Valim. The type system allows incremental adoption — starting with critical APIs — while preserving dynamic flexibility for untyped code. A landmark release for the BEAM ecosystem.

Source: HackerNews
Elixir v1.20 is now a gradually typed language

Elixir v1.20 Is Now a Gradually Typed Language — A Major Milestone for the BEAM Ecosystem

Elixir v1.20 has been released, and it brings a transformative feature that the community has been anticipating for years: gradual typing. This release marks a fundamental evolution for the functional programming language, bringing static type checking to the BEAM virtual machine ecosystem while preserving the dynamic flexibility that Elixir developers value.

The official announcement, published on elixir-lang.org on June 3, 2026, confirms that gradual typing is now a core part of the language. Types are defined through set-theoretic types — using set operations like union, intersection, and negation to describe type relationships — an approach that provides both precision and expressiveness.

What Gradual Typing Means for Elixir

Gradual typing means Elixir developers can add type annotations to their code incrementally. Functions, modules, and variables can be typed where static guarantees are most valuable, while untyped code continues to work exactly as before. The type checker analyzes typed code at compile time, catching type errors before they reach production, while untyped regions remain dynamically checked at runtime.

This approach is particularly well-suited to Elixir's philosophy of developer productivity. Teams can start by typing critical interfaces and public APIs, then extend type coverage over time as the benefits become apparent.

Set-Theoretic Types

The type system is based on set-theoretic types, a mathematical framework where types are defined as sets of values. Union types allow a value to be one of several types, intersection types require a value to satisfy multiple type constraints, and negation types exclude specific values from a type. This provides a rich vocabulary for describing complex data shapes while maintaining mathematical rigor.

This approach was inspired by the work on Gleam and other BEAM languages that have explored type systems for the Erlang virtual machine. The Elixir team spent several years developing and refining the implementation, drawing on academic research in type theory as well as practical lessons from typed functional languages.

A Multi-Year Development Journey

The gradual type system was developed over several years of research and implementation by the Elixir core team, led by José Valim. The project drew inspiration from type systems in languages like TypeScript (for gradual typing patterns), Gleam (for BEAM-specific type considerations), and academic research on set-theoretic types.

The release represents one of the most significant technical achievements in Elixir's history. For the BEAM ecosystem, it brings Elixir closer to languages with sophisticated type systems while maintaining the Erlang interoperability and fault-tolerance characteristics that make the platform unique.

Community Impact

The addition of gradual typing is expected to accelerate Elixir adoption in domains where type safety is critical, including financial systems, healthcare, and infrastructure software. It also makes the language more accessible to developers coming from typed languages who may have been hesitant to adopt a dynamically-typed functional language.

Related Articles