On 26-Sep-2000, Ch. A. Herrmann <[EMAIL PROTECTED]> wrote:
> What happens, if
>
> (a) an optimizer replaces (x==x) by True?
> If the optimizer is not permitted to do that,
> its power appears to be limited severely.
If I was implementing an optimizing Haskell compiler, I would go ahead
and implement such optimizations, but enable them only if the user
invokes the compiler with a certain compiler option set.
Setting that option would make the compiler not conform to the Haskell
Report. But if it made a significant difference to performance, users
who cared about performance would use it anyway. If it made enough of
a difference, and enough users used it, there might even be support for
standardizing this option in some future Haskell report...
There's certainly a precedent for this in at least one other language ;-)
The Mercury compiler has an option similar to this (`--no-fully-strict'),
and the Mercury language reference manual explicitly allows this.
--
Fergus Henderson <[EMAIL PROTECTED]> | "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh> | of excellence is a lethal habit"
PGP: finger [EMAIL PROTECTED] | -- the last words of T. S. Garp.