[erlang-questions] Remove behaviour checking from erl_lint (continued)
Tue Dec 20 09:36:07 CET 2016
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.
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 dynamic typing in Erlang. With static typing in C/C++ the linting can happen along with compilation. Even if Erlang changes to process Erlang/OTP applications as chunks of modules, that doesn't handle when behaviours would be in other Erlang/OTP applications (also, that processing appears to only exist far in the future or just simply as a discussion topic, nothing concrete to talk/think about right now).
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.
More information about the erlang-questions