Parse transformery (Was: Re: Calling internal functions - foo::bar() ?)

Bjorn Gustavsson bjorn@REDACTED
Wed Mar 9 12:14:11 CET 2005

Thomas Lindgren <thomasl_erlang@REDACTED> writes:

> --- "Ulf Wiger (AL/EAB)" <ulf.wiger@REDACTED>
> wrote:
> Alas, for optimization purposes it's the moral
> equivalent of exporting the function. The transform
> introduces an unknown caller to all functions; if the
> compiler does not account for this, certain
> optimizations will be unsafe.

Since the wrapper function presumably is exported,
the optimizer will not generate unsafe code, but will
simply do less optimization.

> (In particular, if you call the function from a "sneak
> export" unknown to the compiler, you roll the dice and
> take your chances. Depending on the optimization in
> question, you are likely to get core dumps (type
> analysis), corrupt data (reuse analysis), etc.)

I assume that the parse transformation inserts one additional
exported function; otherwise there would be now way to call the


Björn Gustavsson, Erlang/OTP, Ericsson AB

More information about the erlang-questions mailing list