[Haskell-cafe] Compiler backend question

Peter Verswyvelen bf3 at telenet.be
Tue Jan 1 05:59:05 EST 2008


If I understand it correctly, the GHC compiler either directly generates 
machinecode, or it uses C as an intermediate language.

I also read somewhere that C is not the most efficient intermediate 
representation for functional languages, and that one gets better 
performance when generating native machine code.

However, from the discussions in this list, I could conclude that the 
low level machine code optimizer of GHC is far from state-of-the-art 
compared to industry standard C/C++ compilers.

I was wondering, why doesn't GHC use the GCC (or any other standard 
compiler) backend intermediate code? The backend of GCC generates highly 
optimized code no? Or is the intermediate code format of GCC (or other 
compilers) not suitable for Haskell?

Another question regarding the backend: a cool feature of the Microsoft 
Visual C++ (MVC) compiler is its ability to perform "LTCG" 
(link-time-code-generation), performing whole program optimization. It 
something like this possible with Haskell / (or the GCC backend?). Would 
it be possible to feed all the generated C code of the GHC compiler into 
the MVC compiler, to generate one big MVC / LTCG generated executable? 
It would be interesting to see how much the whole program optimization 
approach (which can do analysis on the program as if it was a single 
module) would improve performance...

Cheers,
Peter


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20080101/4f032697/attachment.htm


More information about the Haskell-Cafe mailing list