Elixir
Today we celebrate 15 years since Elixir’s first commit! To mark the occasion, we are glad to announce the first release candidate for Elixir v1.20, which performs type inference of all language constructs, with increasing precision.
In this blog post, we will break down exactly what this means, and what to expect in the short and medium term of the language evolution (roughly the next 15 months).
Read the full announcement here:
Release notes:
TL;DR: this release adds type inference of all constructs. At the moment, we expect false positives (warnings that should not be emited), please let us know if you run into those. Also, please let us know about performance. If Elixir v1.20 compiles slower than v1.19, then ping us too. `mix compile –force –profile time` is a good tool to measure it (paticularly the times reported at the end).
Trending in News
Other Trending 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
- #blog-post
- #phoenix_html
- #iex
- #graphql
- #ai
- #genstage
- #elixirconf-us
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #metaprogramming
- #security
- #hex










Showing Posts 1 to 10- Show Best Posts
- Show All Posts (oldest first)
- Show All Posts (newest first)
Eiji
Amazing work!
I found something very surprising … I have 2
Elixirversions installed usingmise:On the first one
1.19.5-otp-28thecredotool does not emits any issues, but in1.20.0-rc.0-otp-28it produces a false positive for only one checkCredo.Check.Readability.ModuleDocfor all modules in my project.Edit: I have found the issue. It appears that
credoexpectedASTmeta for block expression to be an empty list, but in1.20.0-rc.0it contains additionallineandcolumninformation.Edit 2: I have created a quick fix PR: Fix 1.20.x compatibility issue with block expression AST by Eiji7 · Pull Request #1241 · rrrene/credo · GitHub
As a temporary workaround you can use my fork by simply changing the
credodependency to:All other tools (ExUnit tests, ex_coveralls report and dialyzer report) does not seem to change (as expected)
The only one thing I would like to see fixed in
dialyxeroutput are OTP 28 related warnings when buildingPLT, but as mentioned above it’s the same behaviour as in olderElixirreleases and besides that the checks so far works without any problem.AstonJ
BartOtten
Classic. Elixir 1.19 did this for other expressions / constructs and some libs had to adapt (such as this issue of Routex).
Lib maintainers using AST be aware: wildcard match ‘_meta’ the metadata instead of an empty list ‘’
Granted we would have done so before, but I expect most simply adapted AST and never had a thought about that empty metadata list.
BartOtten
Had time to read the release notes and boy I like what I see. Congrats to all involved. The work is invaluable!
ps. I should have written more type violations just to see it in action :’)
jeregrine
My codebase is actually faster compiling with 1.20-rc (otp28) but only just couple dozen ms and well within margins of error. Nice job!
Only curiosity I have is that the compiler catches type mismatches in our tests, tests that were testing errors on wrong input types ha! Suppose in 1.20 we will be able to delete those!
dmarcoux
Awesome!
In the future, will it still be worth it to use Dialyzer? I guess to find unused code, but what about the other checks?
Eiji
Unless
Elixirtype system would generate a@specorex_docwould supportElixir’s Typespec nativelydialyzerwould have a great value at least in documentation purposes. From unknown types to mismatched ones. There are still lots of cases thatdialyzeruses. Also it’s very useful when you assume that your complex logic always returns specific data anddialyzerwarns sometimes it’s not a case. That’s very useful in code refactor when you forgot to update some small part of a bigger module.I wonder if
Elixircore team have any further plans about improvements to type system like mentionedex_docsupport or auto-generation of function@spec. In past we had discussions about new type definitions starting with$character, but I’m not sure how those topics ended up like if those are on the official roadmap or so.LostKobrakai
Any generation of
@specis highly unlikely. Typespecs lack negations like „anything, but an atom“ and therefore are unfit to represent the types inferred by the elixir typesystem.Type signatures are on the roadmap though - see 3. in the ~15 months section. They‘ll surely become part of docs once they exist as well.
tcoopman
Great work! Looking forward to trying this out. So far, I loved all the changes.
Eiji
Yeah, I remember that the type system allowed more stuff. Support for negations would not look good, but is rather possible - it’s just about list every type except the excluded one.
Good to know they are on roadmap, but 15 months is a lot of time especially in our rapidly changing world. Within that time almost everything can change. On
GitHubthere is a discussion that if situation would go that wayTailwindsooner or later may become an abandonware as they loose the traffic (by 80% or so) to their documentation (which is the only place for their paid plans) due to increased LLM usage. Looks like they already lost 75% jobs there.