On 20-Jan-2000, S.D.Mechveliani <[EMAIL PROTECTED]> wrote:
> The questions are:
>
> (1) What laziness freedom is allowed for a Standard function
> implementation?
I think the answer to that is "none".
Implementations are free to optimize code, so long as the
operational semantics that they implement correctly reflects
the source code's denotational semantics. But the denotational
semantics specifies exactly which expressions may evaluate
to bottom (i.e. may return a runtime error or loop), so changing
a function to make it more or less lazy is not allowed.
> (2) Should Haskell consider also the stronger equivalence relation
> on programs?
Opinions on this differ.
But if you're looking for a declarative language which does take
this approach, the only one that I know of is Mercury.
In Mercury, the declarative semantics do not specify when a
procedure can throw an exception or fail to terminate.
That is considered part of the operational semantics.
There is a standard "strict sequential" operational semantics,
and compilers are required to provide a mode which implements
that, but they are also allowed to provide modes which implement
operational semantics which are lazier than the strict sequential
operational semantics.
--
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.