Legend:

You can also watch a '''video''' of Simon Peyton-Jones explaining the compilation pipeline here: [http://video.google.com/videoplay?docid=5254545394467397086 Compiler Pipeline II] (10'16")

7

7

8

Look at the picture first. The yellow boxes are compiler passes, while the blue stuff on the left gives the data type that moves from one phase to the next. The entire pipeline for a single module is run by a module called !HscMain ([[GhcFile(compiler/main/HscMain.lhs)]]). Each data type's representation can be dumped for further inspection using a `-ddump-*` flag. (Consider also using `-ddump-to-file`: some of the dump outputs can be large!) Here are the steps it goes through:

8

Look at the picture first. The yellow boxes are compiler passes, while the blue stuff on the left gives the data type that moves from one phase to the next. The entire pipeline for a single module is run by a module called !HscMain ([[GhcFile(compiler/main/HscMain.hs)]]). Each data type's representation can be dumped for further inspection using a `-ddump-*` flag. (Consider also using `-ddump-to-file`: some of the dump outputs can be large!) Here are the steps it goes through:

9

9

10

10

* The '''Front End''' processes the program in the [wiki:Commentary/Compiler/HsSynType big HsSyn type]. {{{HsSyn}}} is parameterised over the types of the term variables it contains. The first three passes (the front end) of the compiler work like this:[[BR]][[BR]]