Small poll

Luke Gorrie luke@REDACTED
Wed Dec 10 20:30:44 CET 2003


Kostis Sagonas <kostis@REDACTED> writes:

> I was wondering whether the Erlang user community would care
> to comment on the following:
> 
> In a function like:
> 
> 	test(A) ->
> 	    a + 42.
> 
> which is either crap (arguably) or a typo (A vs a), how many
> Erlang users:
> 
>  1. Are content with the current situation where the compiler
> 	happily compiles this program
>  2. Would like to see a warning, but a .beam file generated
> 	nevetheless
>  3. Would prefer if the compiler in R10 refused to compile it

I would like (2). (1) would be a bit weird since there are already
warnings for e.g. unused functions, but (3) might be annoying if I
know test/1 is broken but want to poke around some other functions.

Is this coming from the type-analysis stuff mentioned in the EUC HiPE
presentation? If so, to firmly put myself into broken-record-mode :-),
I think what CMUCL does with the type information it discovers is
pretty nice -- warnings like this and optional "efficiency-notes".

And if you end up doing optional efficiency-notes in HiPE, as in

  foo.erl:10: Bit-syntax pattern is not byte-aligned - not native-compiling
  foo.erl:20: Can't determine operand types in "X*Y*Z" - not inlining '*'

then I promise to hack up a fancy Emacs front-end like CMUCL has

  http://www.bluetail.com/~luke/misc/lisp/slime-shot.png

.. though I won't suggest we have to make the compiler so
unpredictable as to require efficiency-notes just so that the Emacs
mode can be fancier :-)

(And of course Emacs needs to know a little more than just the line
number to figure out what to underline..)




More information about the erlang-questions mailing list