On Jun 28, 2007, at 10:06 AM, Chuck Esterbrook wrote:

Okay this is a bit pie in the sky, but here I go anyway:

Given that functional code can be mathematically reasoned about
(perhaps not including code that contains monads?) and things about
the code can be proved, would it be possible at some point for a
program to rewrite a function to be more efficient, but identical in
definition (not code definition but input --> output definition)?

And is anyone researching something like this that you know of?

So, even though it isn't a purely functional language, I know the CMU Lisp compiler did do this. AFAIK, ghc (the preferred Haskell compiler) has similar bits. In general, you *need* a compiler to be doing this to a certain extent, because the simplest and most naive translations of functional programming to machine language can be horribly inefficient. However, as Prolog has proven all too well, we've not yet reached the stage where we can make a compiler that will always choose the most efficient way to solve a problem. For best performance you need to help it out a bit.

--Chris

--
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-lpsg

Reply via email to