
6 Sep
2006
6 Sep
'06
10:28 a.m.
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. Stefan