Fl4m3Ph03n1x
Background
In a post I made about having static types in Elixir, someone mentioned the tool Gradualizer. This came as a surprise to me, as though I have seen and read quite a lot about Dialyzer, I have never seen an Elixir book mention Gradualizer.
Questions
I understand Gradualizer aims to provide static typing for erlang (and I suppose Elixir) via gradual typing, while Dialyzer takes a different approach.
But as someone who doesn’t understand the differences to both systems, this is new terrain.
- What is the main purpose of Gradualizer in regards to its ancestor? (to replace Dialyzer, be a competitor, improve upon it…)
- What are the main differences between one tool and the other?
- Why should I move to Gradualizer when Dialyzer has been the de facto tool for typing in erlang/elixir since… well, forever?
- Is Gradualizer ready for usage in real projects? (I understand it isn’t, please correct me if I am mistaken)
Trending in Questions
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
Hi everyone,
I am toying with the idea of building a “match maker” for giving personal help to people that wants to start coding.
I sta...
New
Hello,
I know there is an approach for handling lists that allows for optimized traversal, but I can’t recall the specific method (somet...
New
Documentation
While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
New
So my question is quite simple and i have found no conclusive answer on forum, google or AI.
Should we use :erlang.float for Integer to ...
New
I recently noticed that Elixir’s Logger defaults its primary log level to :debug when no :logger, :level application configuration is pre...
New
I’m new to elixir and just tried to install the elixirLS extension for VScode(ium) and it is throwing some errors that I would like help ...
New
Other Trending Topics
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
Hi there! We created Gust: A task orchestrator inspired by Airflow.
For those who have never heard about Aiflow, it’s a Python-based wor...
New
Hi everyone!
The first release candidate for the Expert language server project is now available!
We’ve published a press release detai...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New
With AI doing more of the implementation work, I’ve been wondering how much coding I should deliberately keep doing myself.
My main conc...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixirconf-us
- #ai
- #blog-post
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #elixirconf-eu
- #metaprogramming
- #hex










Showing Posts 11 to 20- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
michallepicki
There is also GitHub - Premwoik/gradualizer-ex · GitHub
OvermindDL1
I was waiting on a few things to finish but never got around back to it, work got crazy in a few different ways than it was before. I specifically never published it because I didn’t consider it to be done enough for that and I didn’t want to potentially steal a good name for such a tool, so please, anyone fork it or remake it.
This might indeed be the remake!
Fl4m3Ph03n1x
GitHub - Premwoik/gradualizer-ex · GitHub has been archived. I understand it is abandoned as well.
As far as I know, both Gradualizer ports to elixir have been put on ice. Until a new stable project comes along, there is no elixir candidate.
eksperimental
There is GitHub - esl/gradient: Gradient is a static typechecker for Elixir · GitHub
Fl4m3Ph03n1x
Have you tried it?
How was your experience?
eksperimental
Errors are not that easy to read and I have the feeling that I get false positive errors which makes you waste lots of time tracking down and trying to fix something that is not broken.
erszcz
Thanks for the feedback! We’re trying to make Gradient as user-friendly as possible - there is significant effort put into making sure it integrates nicely with Elixir, but indeed, the software is still experimental.
Could you create a ticket with an error that you consider hard to read? Or given an example here? I’ll be happy to take it forward.
That’s the never ending story of type checkers / static analysis - how to make the checker detect real problems in code on one hand, yet still be flexible enough to allow for all quirks of the language and full expressiveness on the other. However, even more so in this case, we would be extremely happy if you could report false positives on the project’s GitHub page.
Any feedback is good feedback, so keep it coming
I strongly believe it might only lead to making the tool better!
Getting back to main differences.
Gradualizer has a different approach than Dialyzer in reporting errors. Dialyzer advertises that “it’s never wrong”, which is true, but sometimes its feedback is a bit hard to use (the lovely “function … has no local return” and no direct hint on what to do with it). It’s also quite slow, though it’s not as much of a problem as it used to be a few years ago.
Gradualizer reports more kinds of errors and allows for some tricks known from other statically typed functional programming languages like exhaustiveness checking - see example screenshots of Gradualizer being used with the Erlang Language Server in this post. It’s also significantly faster, as it doesn’t require generating PLTs. Actually, thanks to its speed it’s very convenient as a background tool in the editor. However, in this experimental phase, it means some false positives might get reported.
To get a better feel of what’s possible with Gradualizer, that’s not possible with Dialyzer, you might want to watch my lightning talk about typechecking Elixir from ElixirConf EU 2021 or read about the typestate pattern in Erlang.
In the long run Gradient should offer everything Gradualizer does and maybe even a bit more thanks to some macro magic

eksperimental
Hi,
I gave up on it on this project that had data structures of considerable length and it was taking a lot of time. As my library enters in a more stable status, I will give Gradualizer a second try and report the issues as it is my style.
Gradualizer detected some issues that Diaylzer didn’t so I am grateful for it.
I will try to use the tool as much as possible provided it is in an usable stage, if not put it not in my main flow of development but as an alternative one, and see what it can detect from time to time.
Thank you.
cjbottaro
This would be like a dream come true for me and several coworkers. We love Elixir, but often wish it had “opt-in strict static typing”… which this sounds exactly like “gradual typing”. Thank you for your work on this!
Rich_Morin
Can anyone tell me the status and prospects for type checking of message contents? I’ve only used Dialyzer in the context of a smallish Phoenix project and my impression is that it doesn’t even try to cover inter-process messages (but I could certainly be wrong – clues?).
While I’m at it, what about coverage of Nx-based data structures, etc? And a pony…
-r