[Haskell-cafe] Re: Why can't Haskell be faster?

Derek Elkins derek.a.elkins at gmail.com
Wed Oct 31 21:19:37 EDT 2007


On Wed, 2007-10-31 at 23:44 +0100, Henning Thielemann wrote:
> On Wed, 31 Oct 2007, Dan Piponi wrote:
> 
> > But every day, while coding at work (in C++), I see situations where
> > true partial evaluation would give a big performance payoff, and yet
> > there are so few languages that natively support it. Of course it
> > would require part of the compiler to be present in the runtime. But
> > by generating code in inner loops specialised to the data at hand it
> > could easily outperform C code in a wide variety of real world code. I
> > know there has been some research in this area, and some commercial
> > C++ products for partial evaluation have appeared, so I'd love to see
> > it in an easy to use Haskell form one day.
> 
> I weakly remember an article on Hawiki about that ...

Probably RuntimeCompilation (or something like that and linked from the
Knuth-Morris-Pratt implementation on HaWiki) written by Andrew Bromage.
> 
> If you write
> 
>  foo :: X -> Y -> Z
>  foo x =
>     let bar y = ... x ... y ...
>     in  bar
> 
> would this give you true partial evaluation?

No.  Partial evaluation (usually) implies a heck of a lot more than what
you are trying to do.



More information about the Haskell-Cafe mailing list