Changes between Version 6 and Version 7 of Commentary/Compiler/HscMain


Ignore:
Timestamp:
Sep 8, 2006 1:24:49 PM (9 years ago)
Author:
simonpj
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Commentary/Compiler/HscMain

    v6 v7  
    1010 * The program is initially parsed into the {{{HsSyn}}} types (in the [[GhcFile(compiler/hsSyn)]] directory), a collection of data types that describe the full abstract syntax of Haskell.  {{{HsSyn}}} is a pretty big colleciton of types: there are 52 data types when I last counted.  Many are pretty trivial, but a few have a lot of constructors ({{{HsExpr}}} has 40).  {{{HsSyn}}} represents Haskell its full glory, complete with all syntactic sugar. 
    1111 
    12  * {{{HsSyn}}} is parameterised over the types of the variables it contains.  The first three passes of the compiler work like this: 
     12 * {{{HsSyn}}} is parameterised over the types of the variables it contains.  The first three passes (the front end) of the compiler work like this: 
    1313   * The '''parser''' produces {{{HsSyn}}} parameterised by '''[wiki:Commentary/Compiler/RdrNameType RdrName]'''.  To a first approximation, a {{{RdrName}}} is just a string. 
    1414   * The '''renamer''' transforms this to {{{HsSyn}}} parameterised by '''[wiki:Commentary/Compiler/NameType Name]'''.  To a first appoximation, a {{{Name}}} is a string plus a {{{Unique}}} (number) that uniquely identifies it. 
     
    1616 In addition, the type-checker converts class declarations to {{{Class}}}es, and type declarations to {{{TyCon}}}s and {{{DataCon}}}s.  And of course, the type-checker deals in {{{Type}}}s and {{{TyVar}}}s. The [wiki:Commentary/Compiler/EntityTypes data types for these entities] ({{{Type}}}, {{{TyCon}}}, {{{Class}}}, {{{Id}}}, {{{TyVar}}}) are pervasive throughout the rest of the compiler. 
    1717 
    18  * The '''desugarer''' converts from the massive {{{HsSyn}}} type to GHC's intermediate language, {{{CoreSyn}}} (in the [[GhcFile(compiler/coreSyn)]] direcdtory).  This data type is relatively tiny: just eight constructors; again it has its own page. 
     18 * The '''desugarer''' converts from the massive {{{HsSyn}}} type to [wiki:Commentary/Compiler/CoreSynType GHC's intermediate language, CoreSyn].  This data type is relatively tiny: just eight constructors. 
    1919 
    2020 * The '''SimplCore''' pass ([[GhcFile(simplCore/SimplCore.lhs)]]) is a bunch of Core-to-Core passes that optimise the program.  The main passes are: