[erlang-questions] warnings for "not recommended" usage of language constructs

zxq9 zxq9@REDACTED
Sat May 17 15:58:23 CEST 2014

On Saturday 17 May 2014 11:38:39 Vlad Dumitrescu wrote:
> Hi all,
> Related to my previous post about literal whitespace characters, I wonder
> if it might be a solution acceptable to most (all?) people to add compiler
> options to control if such usage will emit warnings or not. This way one
> can choose to go on as before or to get informed when there are
> controversial constructs in the code.
> At the moment I have two suggestions for such constructs:
> - literal whitespace characters
> - "ill-behaved" macros

The more information we can get from the environment (build tools, compiler, 
runtime, etc.) the better. Warnings, build status, dead code locations, etc. 
The more the better. This is especially true in controversial cases like the 
literal whitespace one that could so easily go unnoticed.

I'm particularly fond of having the option of a logically independent lint-
type pre-processing step that checks if code is conforming to whatever the 
community canon is and raises warnings (or interrupts the build, etc.) before 
the compiler gets a hold of the code. The reason I like this way more than 
making everything a compiler warning is that it leaves the compiler 
implementation logically dependent only on the language definition, and the 
linting process free to embrace as much arbitrary knowledge from the community 
as the implementers have time for. It also leaves the option of different 
linters/rules to be inserted in that step instead of only leaving room for the 
One True Way and drastically limits the size of the compiler manpage by 
preventing compiler option proliferation over time.

More information about the erlang-questions mailing list