[erlang-questions] soft/optional typing

Tobias Lindahl tobias.lindahl@REDACTED
Wed Jun 13 10:14:54 CEST 2007


Hi Raoul,

Raoul Duke wrote:
> hi,
> 
> What with HiPE and Dialyzer, seems like optional/soft/pluggable typing
> in Erlang (ideally with some inference) isn't such an odd thing.
> Googling around it appears there have been various developments along
> those lines - is there anything currently active?

We have a type inference for erlang based of the notion of Success 
Typings described in 
http://user.it.uu.se/~tobiasl/publications/succ_types.pdf This type 
inference is the basis of Dialyzer's plt analysis. With the upcoming 
release of Erlang/OTP R11B-5 you can access the full analysis by giving 
the option --succ_typings to dialyzer. Many more bugs are found, but 
some of the warnings might be hard to interpret. This is the reason it 
is not on by default, but we are working to weed these problems out.

Based on the same analysis is also the type annotation tool Typer 
(currently an unsupported part of otp). You can look at the description 
in http://user.it.uu.se/~tobiasl/publications/typer.pdf although the 
current version differs a bit from the description. Try bin/typer -h for 
some more instructions on how to use it.

A current work is to incorporate a contract language in the framework, 
in both order to get better analysis results, and to serve as a 
complement to the edoc documentation. These contracts are currently 
expressed as type schemes with bounded quantification. The first 
priority is not to build a type checker since this would limit the 
expressibility of Erlang. Instead we would like the users to 
incrementally add type information where they want, and the anlysis can 
tell you where the information cannot be correct. If the analysis cannot 
find any inconsistencies, the contracts are trusted and can be used to 
find better information in the later stages.

The results from the contract work looks promising and we hope to 
present it on the Erlang Workshop.

Best,
Tobias


> 
> many thanks.
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://www.erlang.org/mailman/listinfo/erlang-questions



More information about the erlang-questions mailing list