[erlang-questions] Why isn't erlang strongly typed?

Kostis Sagonas <>
Thu Oct 23 00:54:45 CEST 2008


Michael Radford wrote:
> Richard O'Keefe writes:
>>> I'm sure that there's a simple and convincing answer to this.
>> Because Erlang was designed for systems that are
>> supposed to be running all the time, even when you
>> want to install upgraded software with *different*
>> types.
>>
>> There have been several attempts to provide type systems
>> for Erlang.  It took a long time to get one that was
>> found to be satisfactory in practice, but it's there now
>> in documentation and in the Dialyzer and Typerl.
> 
> I'm not familiar with Typerl, but Dialyzer only does static analysis
> for a single version of each module, right?  (It provides no way
> to check the correctness of a code_change handler between two versions?)

I think you are mixing two things: Dialyzer does not provide any way 
whatsoever to check the type correctness of a set of modules.  PERIOD.

What Dialyzer does provide is analysis that finds *definite type errors* 
in a set of modules.  There is a big difference between finding definite 
type errors and proving the absence of (a class of) type errors.

However, under that prism, Dialyzer can indeed find type clashes between 
the original version of an application (modules M1,...,Mi, O1,...,Oj) 
and the new ones (N1,..., Nk) that will replace the Ojs.

You just analyze off-line the set M1,...,Mi, N1,..., Nk and Dialyzer 
will report any discrepancies and incompatibilities it finds.  Note that 
this does not guarantee that there will be no runtime type errors.

Kostis



More information about the erlang-questions mailing list