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

Loïc Hoguin <>
Tue Dec 20 10:21:31 CET 2016


On 12/20/2016 09:36 AM, Michael Truog wrote:
> On 12/19/2016 11:09 PM, Michał Muskała wrote:
>> Right now when I don't implement a callback I get the feedback from
>> the compiler in a matter of seconds - the compiler is very quick even
>> on large projects since it can be incremental. Moving the check to
>> dialyzer will mean I need to launch a separate program and wait for
>> its output, potentially couple minutes. This doesn't sound like an
>> improvement to me.
>>
>> Michał.
>>
> It may not seem like an improvement, but it is required due to the
> compiler needing to focus only on the module it is trying to compile.
> Any error checking that involves other modules needs to rely on
> something else, with dialyzer being the Erlang linting tool due to the

I believe Dialyzer already checks this, perhaps not exactly the same 
way, and with missing behavior modules not being considered errors.

> Your main complaint is the speed of execution of dialyzer, and that is
> another valid problem.  An easy way to try to fix the slowness in
> dialyzer is try to make it do less, where enabling more checks requires
> more flags.  The slowness perceived in dialyzer appears to be the main
> reason given for manual usage of xref, so there are also people that
> would prefer using xref instead, just simply due to it doing less and
> executing quicker when doing less.  My main concern is just being able
> to have a dependable toolchain for Erlang usage, so creating a new lint
> tool doesn't seem like a bad option for me.  Worst case is that it would
> only do behaviour checking, and could grow to whatever is required that
> dialyzer doesn't need to cover (just easy checks that doesn't require
> dialyzer's use of memory or execution time). That approach probably
> wants something more like xref.  However, xref seems to provide a long
> list of false negatives when it is used and it has tons of options to
> make it used in countless ways, not making it a simple tool that
> everyone wants to use for all their development.

I'm not sure what you mean. It's not hard to run xref once with warnings 
that provide no false positives, and if necessary have a more 
informative run with possible false positives. Both runs will be largely 
faster than Dialyzer (maybe not that much on trivial projects when the 
PLT is already built, but definitely on projects with many modules, or 
huge generated modules and so on).

I believe xref should be made more approachable though, either in 
documentation or interface. It seems to be capable of a lot more than 
"rebar xref".

Cheers,

-- 
Loïc Hoguin
https://ninenines.eu


More information about the erlang-questions mailing list