Elixir
Elixir v1.20.0-rc.2 and v1.20.0-rc.3 released
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: :interpretedoption toCodewhich 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.beamfile, 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!/1andList.last!/1 - Add Software Bill of Materials guide to the Documentation
Mix
- [mix compile] Add
module_definition: :interpretedoption toCodewhich 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.beamfile, 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) andmod.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
Most Liked
josevalim
Yes, some of the new checks are expensive and we got bug reports, we are looking into optimized them right now. ![]()
josevalim
We have released v1.20.0-rc.3 with many performance improvements around the type system. See the CHANGELOG below.
For those using Absinthe, I have created this pull request which I recommend using until v1.9.1 is out: perf: Break function dispatch into groups by josevalim · Pull Request #1414 · absinthe-graphql/absinthe · GitHub
1. Enhancements
IEx
- [IEx] Optimize autocompleting modules
2. Bug fixes
Elixir
- [Enum] Fix
Enum.slice/2for ranges with step > 1 sliced by step > 1 - [File] Preserve directory permissions in
File.cp_r/3 - [File] Fix
File.cp_r/3infinite loop with symlink cycles - [File] Fix
File.cp_r/3infinite loop when copying into subdirectory of source - [File] Warn when defining
@type record(), fixes CI on Erlang/OTP 29 - [File] Fix
File.StreamEnumerable.countfor files without trailing newline - [Float] Fix
Float.parse/1inconsistent error handling for non-scientific notation overflow - [Kernel] Process fields even when structs are unknown (regression)
- [Kernel] Improve performance on several corner cases in the type system (regression)
- [Kernel] Fix regression when using
Kernel.in/2in defguard (regression)
josevalim
As with previous RCs, give it a try and let us know about compilation times and any false or unclear warnings!
Popular in News
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance









