github elixir-lang/elixir v1.20.0-rc.2

pre-release5 hours ago

Overall, the compiler finds more bugs, for free, and it has never been faster:

  • Infers types across clauses, finding more bugs and dead code

  • Compiles ~10% faster and has a new interpreted mode (up to 5x faster, scales to the number of cores). For more information, follow the benchmarks

  • Modifying a struct definition recompiles fewer files (it no longer requires files that only pattern match or update structs to recompile)

1. Enhancements

Elixir

  • [Code] Add module_definition: :interpreted option to Code which allows module definitions to be evaluated instead of compiled. In some applications/architectures, this can lead to drastic improvements to compilation times. Note this does not affect the generated .beam file, which will have the same performance/behaviour as before
  • [Code] Make module purging opt-in and move temporary module deletion to the background to speed up compilation times
  • [Integer] Add Integer.popcount/1
  • [Kernel] Move struct validation in patterns and updates to type checker, this means adding and remove struct fields will cause fewer files to be recompiled
  • [Kernel] Add type inference across clauses. For example, if one clause says x when is_integer(x), then the next clause may no longer be an integer
  • [Kernel] Detect and warn on redundant clauses
  • [List] Add List.first!/1 and List.last!/1
  • Add Software Bill of Materials guide to the Documentation

Mix

  • [mix compile] Add module_definition: :interpreted option to Code which allows module definitions to be evaluated instead of compiled. In some applications/architectures, this can lead to drastic improvements to compilation times. Note this does not affect the generated .beam file, which will have the same performance/behaviour as before
  • [mix deps] Parallelize dep lock status checks during deps.loadpaths, improving boot times in projects with many git dependencies

2. Potential breaking changes

Elixir

  • map.foo() (accessing a map field with parens) and mod.foo (invoking a function without parens) will now raise instead of emitting runtime warnings, aligning themselves with the type system behaviour

3. Bug fixes

IEx

  • [IEx] Ensure warnings emitted during IEx parsing are properly displayed/printed
  • [IEx] Ensure pry works across remote nodes

Mix

  • [mix compile.erlang] Topsort Erlang modules before compilation for proper dependency resolution

Don't miss a new elixir release

NewReleases is sending notifications on new releases.