[Haskell-cafe] Re: does the compiler optimize repeated calls?

Stefan Monnier monnier at iro.umontreal.ca
Wed Sep 6 10:28:38 EDT 2006

> Purely functional does give you some performance benefits, though.

Nice theory.  People don't use functional languages for their performance,
mind you.  All the optimizations that are supposedly made possible by having
a pure functional language tend to be either not quite doable (because of
non-termination making the language a bit less pure) or simply too hard: the
difficulty being to decide when/where the optimization is indeed going to
improve performance rather than worsen it.

It's much too difficult for a compiler to figure out which functions might
benefit from memoization (and with which specific form of memoization).
Especially compared with how easy it is for the programmer to do the
memoization explicitly.


More information about the Haskell-Cafe mailing list