[mercury-users] Mostly unique modes?

Zoltan Somogyi zs at cs.mu.OZ.AU
Mon May 17 15:29:59 AEST 2004


On 17-May-2004, Peter Hawkins <peter at hawkins.emu.id.au> wrote:
> (Incidentally, is there a particular problem if I lie to the compiler about 
> the purity of my code? In what circumstances will it bite me?)

If you tell the compiler that your code is impure when in fact it is pure,
you will get bitten by the compiler not optimizing your code as well as it
could.

However, it is far more likely that you want to know what will happen
if you tell the compiler that your code is pure when in fact it is impure.
In that case, the compiler may optimize away code whose execution you
are counting on. Some of my work has been with program transformations
which create impure code, and I can tell you from experience that
forgetting to place an impure marker on some pieces of code often
has this effect.

Zoltan.
--------------------------------------------------------------------------
mercury-users mailing list
post:  mercury-users at cs.mu.oz.au
administrative address: owner-mercury-users at cs.mu.oz.au
unsubscribe: Address: mercury-users-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-users-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the users mailing list