[Haskell-cafe] (Chaos) [An interesting toy]

Andrew Coppin andrewcoppin at btinternet.com
Mon May 7 09:36:13 EDT 2007


Simon Peyton-Jones wrote:
> | Ah well, I doubt I'm going to come up with any new ideas for how to make
> | my code go faster, but it's mildly entertaining wading through over 200
> | KB of textual output trying to guess what it means.
>
> Ha ha.  You did say that you wanted to know what GHC *really* does :-)
>   

I know. I'm not "really" complaining. ;-)

> Seriously, there is mileage in someone working on the core-language pretty-printer to make it less intimidating.  It was never really designed for wide consumption, and could be a lot better.  Suppressing more qualified names, for example.
>   

I wonder... is there a high-level document anywhere which explains what 
GHC actually does with your code when you compile it? I mean, presumably 
the first thing it does is check whether the source is parsable, 
syntactically correct, type checks, etc. As I understand it, it then 
translates the program into Core, does some Core-to-Core transformations 
(I have no idea what transformations), and finally feeds that into a 
code generator - either assembly or C. That's about all I know. I mean, 
I'm *presuming* that the final compiled form is some kind of 
graph-reduction machine... but I don't really know.

(On the other hand, presumably the GHC developers spend more time, like, 
*developing* GHC rather than writing about how it works...)



More information about the Haskell-Cafe mailing list