Small poll

Bjorn Gustavsson bjorn@REDACTED
Fri Dec 12 11:08:21 CET 2003


Kostis Sagonas <kostis@REDACTED> writes:

[...]
> Now let me tell you why I am interested in 3:
> 
>   In the context of generating native code, it is really a nuisance
>   to have to handle all sorts of illegal combinations of arguments
>   to "basic" primitives like "+".  Moreover, in the case of HiPE,
>   because the compiler is (much) more sophisticated than the BEAM
>   one, it actually discovers quite a lot more cases of such errors.
>   Currently, we try our best to "immitate" the behaviour of the BEAM
>   compiler, but in sleepless nights like this one, I keep wondering
>   whether there should really be a limit to the level of naivety
>   one pretends to show, or shouldn't there be?
> 

We in the OTP team are planning for the R10B release to generate more
warnings for suspect code. We will do that in one of the Core Erlang
passes (which is common pass used for both threaded Beam code and native
HiPE code). At the same time as the warning is generated, the offending
code will be replaced with an explicit failure (e.g. erlang:fault/2), that
should be no problem for the later HiPE passes to handle.

Thus, the work only needs to be done once.

As I have already written in a previous answer, we have different opinions
within the Erlang/OTP team at Ericsson whether #2 or #3 is the best solution,
but as someone pointed out, most of work is in detecting the suspect code
anyway. Either #2 or #3 will be implemented in the common parts of the
compiler in R10B.

/Bjorn
-- 
Björn Gustavsson, Erlang/OTP, Ericsson AB



More information about the erlang-questions mailing list