Go to the first, previous, next, last section, table of contents.

The (batch) compilation system components

The Glorious Haskell Compilation System, as with most UNIX (batch) compilation systems, has several interacting parts:

  1. A driver `ghc' -- which you usually think of as "the compiler" -- is a program that merely invokes/glues-together the other pieces of the system (listed below), passing the right options to each, slurping in the right libraries, etc.
  2. A literate pre-processor `unlit' that extracts Haskell code from a literate script; used if you believe in that sort of thing.
  3. The Haskellised C pre-processor `hscpp', only needed by people requiring conditional compilation, probably for large systems. The "Haskellised" part just means that `#line' directives in the output have been converted into proper Haskell `{-# LINE ... -}' pragmas. You must give an explicit `-cpp' option for the C pre-processor to be invoked.
  4. The Haskell compiler `hsc', which -- in normal use -- takes its input from the C pre-processor and produces assembly-language output (sometimes: ANSI C output).
  5. The ANSI C Haskell high-level assembler :-) compiles `hsc''s C output into assembly language for a particular target architecture. (It doesn't have to be an ANSI C compiler, but that's preferred; to go fastest, you need GNU C, version 2.x.)
  6. The assembler -- a standard UNIX one, probably `as'.
  7. The linker -- a standard UNIX one, probably `ld'.
  8. A runtime system, including (most notably) a storage manager; the linker links in the code for this.
  9. The Haskell standard prelude, a large library of standard functions, is linked in as well.
  10. Parts of other installed libraries that you have at your site may be linked in also.


Go to the first, previous, next, last section, table of contents.