Fl4m3Ph03n1x

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.

  1. What is the main purpose of Gradualizer in regards to its ancestor? (to replace Dialyzer, be a competitor, improve upon it…)
  2. What are the main differences between one tool and the other?
  3. Why should I move to Gradualizer when Dialyzer has been the de facto tool for typing in erlang/elixir since… well, forever?
  4. Is Gradualizer ready for usage in real projects? (I understand it isn’t, please correct me if I am mistaken)

Showing Posts 1 to 10

LostKobrakai

LostKobrakai

Dialyzer was build on the idea of success typing. This makes so that dialyzer can work even without user input, just based on code itself. It also tries to not report false positives quite heavily. But it comes with the downside of not detecting many of the error cases other static typing systems can detect. (The link below even argues that dialyzer is not a type system)

Gradualizer is a completely different approach. Afaik it doesn’t do type inference, so unless you manually provide typespecs it does nothing. But for the places you do provide them, it’ll statically check for errors even beyond what dialyzer would be able to detect or would acknowledge. The other big part between the lines is that you can gradually add type safety to your systems. It’ll work with as much typespecs as the code does provide.

For more details see this one:
https://github.com/josefs/Gradualizer/blob/master/talks/talk.md#comparison-with-dialyzer

Essentially both tools try to detect errors, but do that in quite different ways with therefore quite different tradeoffs.

dimitarvp

dimitarvp

Have you used both tools in concert in a project? I’m curious since I’m considering it.

LostKobrakai

LostKobrakai

I have not. I’ve just seen the talk about gradualizer.

egze

egze

Are there any tutorials/articles how to use gradualizer with Elixir?

Fl4m3Ph03n1x

Fl4m3Ph03n1x OP

@OvermindDL1 created Gradualixir ( GitHub - OvermindDL1/gradualixir: Gradualizer Mix Wrapper · GitHub ). Right now I think it is the best shot at using Gradualizer with Elixir. If you have any questions you can probably ask him.

OvermindDL1

OvermindDL1

I think gradualixir is in a slightly broken state due to recent changes in gradualizer (again), PR’s to fix welcome, and I probably need to track specific commits instead of master until gradualizer publishes it’s first release. :sweat_smile:

But when it works you just run mix gradualizer to scan your whole project or mix gradualizer files.beam morefiles.beam path/**/to/files/*.beam, recommend to do individual files for now to work on errors at a time to fix things (when it’s in a working state). Gradualixir itself passes gradualizer (and dialyzer) with flying colors though. :grinning_face_with_smiling_eyes:

egze

egze

I heard the Running in Production podcast where you talked about Gradualizer and other stuff. Very nice episode :slight_smile: You seem to follow the development of Gradualizer closely, do you know when it will stable enough to use and what the current state is?

OvermindDL1

OvermindDL1

Seems to be progressing fairly quickly, dev seems to have slowed lately as most of it is pretty well done now, mostly just needs more typespecs fixing broken typespecs. Other than that it’s usable now for most things, just more typespecs, lol.

Rich_Morin

Rich_Morin

The most recent commit to Gradualixir was almost two years ago. Can someone give me an idea of its current status and prospects? Is anyone using it as a production tool?

-r

Rich_Morin

Rich_Morin

(crickets…)

Where Next? Top

Trending in Questions Top

katta
I having some trouble figuring out if I have set myself too strict of standards for my production server. Currently I can handle 75% of r...
New
brecabral
Documentation While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
New
achenet
Hello, I’m trying to build a basic Phoenix web-app, and I’d like to use Tailwind. However, when I launch mix phx.server, I get an error...
New
kpanic
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
velrest
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
asweet-confluent
I recently noticed that Elixir’s Logger defaults its primary log level to :debug when no :logger, :level application configuration is pre...
New
mnkhod
So i have been using ash framework for a while and i love it. However currently the issue im having with ash framework is the error handl...
New

Other Trending Topics Top

GenericJam
Edit: 2026 May 15 - This post is archived. Mob is alive!! Main docs: mob v0.7.11 — Documentation A bit of explanation for the slightly c...
New
JesseHerrick
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
mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
garrison
Hobbes is a low-level distributed database for the Elixir programming language. Hobbes provides a simple, safe, and scalable storage lay...
New
mhanberg
Hi everyone! The first release candidate for the Expert language server project is now available! We’ve published a press release detai...
New
budgie
A little off-topic, but I feel like people here have a good head on their shoulders. I used to be quite good at making software. Was luc...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews