[Haskell-cafe] Re: Channel9 Interview: Software Composability and theFu ture of Languages

Mark T.B. Carroll mark at ixod.org
Wed Jan 31 11:30:33 EST 2007

Magnus Therning <magnus at therning.org> writes:

> Now, correct me if I'm wrong, but you see a "natural" ordering in your
> haskell expressions, right?


> However the compiler/interpreter
> has to choose a sequence in order to arrive at a result, since that's
> how today's computers work.  (Choosing well can be seen as optimisation
> :-)


Ah, I may see my confusion then - I do see a natural ordering in my
Haskell expressions, and indeed evaluation order could be different so
long as the end result is the same, but I don't find that different to
imperative languages - I would expect modern compilers to reorder
statements if they can get better results out of it without affecting
the answer. (E.g., if I specify a set of assignments where some
reordering leaves the answers unchanged, but clusters uses of values
better so that the dataflow is such that they can stay in registers, I'd
expect the compiler to go ahead - so even where I do specify evaluation
order in C or whatever, I don't particularly expect the compiler to
respect that in cases where I won't notice that it didn't.)

-- Mark

More information about the Haskell-Cafe mailing list