Gradualizer: A Gradual Type System for Erlang
A type checker for Erlang
Gradualizer aims to integrate well into existing Erlang code bases in a non intrusive way. It does so by
having a type system that is based on the principles of Gradual Typing
using the existsing type specs syntax in Erlang.
allowing for granular opt-in of type checking. Without any type specs, no static typing happens.
When type specs are added the program the program is checked against these specs statically. The more type specs, the more static typing.
To run Gradualizer from the command line:
Compile the project as an escript:
To run Gradualizer from the Erlang shell:
Launch the interactive prompt with all the relevant modules in the path:
From the prompt you can run the type checker as follows:
You can try typechecking some of the example modules in the
To run Gradualizer from rebar3, read
The Gradualizer requires at least OTP 19 and is built using rebar3.
The Gradualizer is in alpha. There are plenty of things that don't work right now. It is not meant for public consumption. That being said, pull requests are most welcome!
A non-exhaustive list of things which need fixing:
- Integrate gradualizer with editors and build tools
- Support for intersection types
- Support for subtype polymorphism
- Support for all language constructs in Erlang