Tech News
← Back to articles

Elixir 1.19

read original related products more articles

Elixir v1.19 released: enhanced type checking, broader type inference, and up to 4x faster compilation for large projects

Elixir v1.19 brings further improvements to the type system and compilation times, allowing us to find more bugs, faster.

Type system improvements

This release improves the type system around two key areas: type inference and type checking of anonymous functions and protocols. These enhancements seem simple on the surface but required us to go beyond existing literature by extending current theory and developing new techniques. We will outline the technical details in future articles. For now, let’s look at what’s new.

Type inference of all constructs

Type inference (or reconstruction) is the ability of a type system to automatically deduce, either partially or fully, the type of an expression at compile time. Type inference may occur at different levels. For example, many programming languages can automatically infer the types of variables, also known “local type inference”, but not all can infer type signatures of functions.

Originally, our plan with Elixir’s upcoming type system was to support type inference of patterns, guards, and return types. Therefore, if you wrote this simple function:

def even? ( x ) when is_integer ( x ) do rem ( x , 2 ) == 0 end

Elixir would correctly infer the type to be integer() -> boolean() . However, if you wrote this function:

def even? ( x ) do rem ( x , 2 ) == 0 end

... continue reading