[erlang-questions] Remove behaviour checking from erl_lint (continued)

Michael Truog <>
Thu Dec 22 01:51:20 CET 2016


On 12/21/2016 04:13 PM, Richard A. O'Keefe wrote:
> Let me offer another perspective.
>
> Once you add -type and -spec declarations to your Erlang code,
> it becomes ASTONISHING that your code is not in fact type checked
> by the compiler.
>
> There is no other programming language that I use or have ever
> used in which source code *with* type information isn't checked
> by the normal compiler, to the extent that it *can* be checked
> locally.
>
> It is fatally easy to think that because you took care
> to write -type and -spec and the compiler is silent that
> your code is type correct, when it isn't.
>
> Long term, we should not be shunting off ever more checking
> from the compiler to the dialyzer; on the contrary, the
> dialyzer as a separate tool should disappear.  There should
> still be some compiler option to say how *much* checking is
> to be done, but the default should be "I'll check everything
> I can within the limits of what you've given me".
>
It doesn't seem like what you have said is as specific as it could be.  I agree it would be nice to have the compiler to type checking on the single module it is processing.  However, are you suggesting that the Erlang compiler that is fed a single module should know about all other modules that will be used along with it, at the same time, and effectively run dialyzer on the single module?  Since, if so, that should inherit the speed and memory problems dialyzer has, only they would be multiplied by the number of modules being processed due to the overhead involved.  That would be a way of avoiding the need for dialyzer though.



More information about the erlang-questions mailing list