[Haskell-cafe] GHC magic optimization ?

Eugene Kirpichov ekirpichov at gmail.com
Thu Dec 3 10:53:06 EST 2009


Hi.

There is actually no magic at all going on. Haskell has a reasonably
well-defined evaluation model; you can approximate it, at least not
taking IO into account, with lazy graph reduction (look that up on
google). Probably that is the "mathematical truth" you're looking for.

Actually, if Haskell had any magic, it would be bad, because magic
can't be reliable (if you can't describe it, you can't rely on it) and
your magically-efficient program would suddenly and unexplainably
break at random changes in the source or in the compiler version.

I remember being slightly shocked when I discovered that even in
Prolog no magic is going on and it has a well-defined evaluation
model, too (before that, when I only heard of Prolog but hadn't read
anything serious about it, I thought that it is a bunch of unthinkable
theorem proving wizardry).


2009/12/3 Emmanuel CHANTREAU <echant+haskell at maretmanu.org>:
> Hello
>
> One thing is magic for me: how GHC can know what function results to
> remember and what results can be forgotten ?
>
> Is it just a stupid buffer algorithm or is there some mathematics
> truths behind this ?
>
> I'm very happy about Haskell, it's so great to put some smart ideas in
> a computer.
>
> thanks
>
> --
> Emmanuel Chantréau
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>



-- 
Eugene Kirpichov
Web IR developer, market.yandex.ru


More information about the Haskell-Cafe mailing list