Changes between Version 3 and Version 4 of Commentary/Compiler


Ignore:
Timestamp:
Oct 20, 2006 9:32:00 PM (8 years ago)
Author:
simonpj
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Commentary/Compiler

    v3 v4  
    33= GHC Commentary: The Compiler = 
    44 
     5The compiler itself is written entirely in Haskell, and lives in the many sub-directories of the [[GhcFile(compiler)]] directory.  Here is a block diagram of its top-level structure: 
     6 
    57[[Image(ghc-top.png)]] 
     8 
     9== Contents == 
     10 
     11 * [wiki:ModuleDependencies Compiler Module Dependencies] (deals with the arcane mutual recursions among GHC's many data types) 
     12 * [wiki:Commentary/CodingStyle Coding guidelines] 
     13     [[BR]][[BR]] 
     14 * [wiki:Commentary/Compiler/HscMain Compiling one module: HscMain] 
     15 * Key data types (Simon PJ's diagram is attached at the bottom of this document): 
     16   * [wiki:Commentary/Compiler/HsSynType The source language: HsSyn]  
     17   * [wiki:Commentary/Compiler/RdrNameType RdrNames, Modules, and OccNames] 
     18   * [wiki:Commentary/Compiler/NameType Names] 
     19   * [wiki:Commentary/Compiler/EntityTypes Entities]: variables, type constructors, data constructors, and classes. 
     20   * Types: [wiki:Commentary/Compiler/TypeType Type and Kind], [wiki:Commentary/Compiler/FC equality types and coercions] 
     21   * [wiki:Commentary/Compiler/CoreSynType The core language] 
     22   * [wiki:Commentary/Compiler/StgSynType The STG language] 
     23   * [wiki:Commentary/Compiler/CmmType The Cmm language] 
     24   * ModIface, ModDetails, ModGuts 
     25 * Passes: 
     26   * [wiki:Commentary/Compiler/Renamer Renamer] 
     27   * Typechecker 
     28   * Desugarer 
     29   * Core->core 
     30     * [wiki:Commentary/Compiler/StrictnessAnalysis Strictness analysis] 
     31   * Core->CorePrep 
     32   * [wiki:Commentary/Compiler/Core2Stg CorePrep->Stg] 
     33   * [wiki:Commentary/Compiler/CodeGen The code generator]: Stg->Cmm 
     34       [[BR]][[BR]] 
     35 * [wiki:Commentary/Compiler/API The GHC API] 
     36 * [wiki:Commentary/Compiler/SymbolNames Symbol names and the Z-encoding] 
     37 * [wiki:Commentary/Compiler/TemplateHaskell Template Haskell] 
     38 * [wiki:Commentary/Compiler/WiredIn Wired-in and known-key things] 
     39 * [wiki:Commentary/Compiler/Packages Packages] 
     40 * [wiki:Commentary/Compiler/Finder The Finder] 
     41 * [wiki:Commentary/Compiler/Backends Backends]: 
     42   * [wiki:Commentary/Compiler/Backends/PprC C code generator] 
     43   * [wiki:Commentary/Compiler/Backends/NCG Native code generator] 
    644 
    745The GHC API is the interface exported by compiler/main/GHC.hs. To compile a Haskell module that uses the GHC API, use the flag {{{-package ghc}}} (in GHC 6.6 and later). GHC itself contains a few front-ends: