<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
</head>
<body bgcolor="#ffffff" text="#000000">
<font face="Helvetica, Arial, sans-serif">If I understand it correctly,
the GHC compiler either directly generates machinecode, or it uses C as
an intermediate language.<br>
<br>
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.<br>
<br>
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.<br>
<br>
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?<br>
<br>
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 </font><font face="Helvetica, Arial, sans-serif">MVC</font><font
face="Helvetica, Arial, sans-serif"> compiler, to generate one big </font><font
face="Helvetica, Arial, sans-serif">MVC</font><font
face="Helvetica, Arial, sans-serif"> / 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...<br>
<br>
Cheers,<br>
Peter<br>
<br>
<br>
</font>
</body>
</html>