On 11/11/2010 12:38 PM, Darren New wrote:
>
> It's a lazy calculation. Hopefully the compiler can figure out when it
> doesn't actually need to do that.
>
However, as I understand it (keeping in mind that I don't actually know
Haskell) it does have the implication that it can be much harder to
reason about the efficiency of a program, since it depends quite a bit
on what tricks the compiler can use. This is in contrast to a language
like C where the relative simplicity of the compiler means that the
approximate performance is much more obvious.
It seems like a pretty common double-edged sword. Smarter systems often
allow you to do things more easily at the cost of the need for more
mental space required to know when the smart system will fail and how to
correct it.
Post a reply to this message
|