On 2008 May 17, at 4:10, Carl Mäsak wrote:

Whether we're risking the loss of important compiler optimizations by
allowing overriding of variable RO-ness is not for me to say, that's
up to the compiler writers around here. It seems to me you make it
sound worse than it really is, that optimizations can still be made in
many cases, and that a programmer who turns off RO stricture simply
takes a calculated risk.

The compiler should in fact assume that "is ro" is a hard fact; if the programmer chooses to override, on her own head be it. Examples using other existing languages: GHC doesn't compromise its optimization rules just because someone might be using unsafePerformIO (this is in fact quite similar as unsafePerformIO means a presumed read-only expression can vary at runtime) or unsafeCoerce#. gcc doesn't compromise its just because someone might use an asm() to do something naughty where the C / C++ layer can't see it. Etc.

I also came to think about this relevant quote from Jamie Zawinski:

Java is a remarkable example of how to do it wrong, for many values of "it".

brandon s. allbery [solaris,freebsd,perl,pugs,haskell] [EMAIL PROTECTED]
system administrator [openafs,heimdal,too many hats] [EMAIL PROTECTED]
electrical and computer engineering, carnegie mellon university    KF8NH

Reply via email to