[Haskell-cafe] speed: ghc vs gcc

Khudyakov Alexey alexey.skladnoy at gmail.com
Fri Feb 20 18:07:39 EST 2009

On Friday 20 February 2009 16:29:29 Bulat Ziganshin wrote:
> Hello haskell-cafe,
> since there are no objective tests comparing ghc to gcc, i made my own
> one. these are 3 programs, calculating sum in c++ and haskell:
> main = print $ sum[1..10^9::Int]
> ... skipped ...

The discussion is mostly about low level optimizations such as loop unrolling 

I have another question. Why shouldn't compiler realize that `sum [1..10^9]' 
is constant and thus evaluate it at compile time? 

  Khudakov Alexey

More information about the Haskell-Cafe mailing list