Changes between Version 6 and Version 7 of ExternalCore


Ignore:
Timestamp:
Nov 7, 2006 8:08:21 PM (9 years ago)
Author:
guest
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ExternalCore

    v6 v7  
    33The {{{ExternalCore}}} data type is used by GHC to communicate code represented in the [wiki:Commentary/Compiler/CoreSynType Core] data type with the outside world. It comes with an external syntax, a parser, a pretty printer, and code to convert between Core and External Core. Unfortunately, External Core has not been widely used, and the code has bit-rotted. The recent changes in Core to use [wiki:Commentary/Compiler/FC System FC] have exacerbated the problem. This page documents the process of getting External Core and Core back in sync.
    44
     5Once the process is finished, this page will just describe the design.
    56
    67== Relevant files ==
     
    2526  * [http://www.haskell.org/ghc/docs/latest/html/users_guide/ext-core.html]: What the User's Guide currently has to say about External Core.
    2627
    27 == Design decisions ==
     28== Design changes ==
    2829
    29   * Probably want to represent all data types as GADTs, even if they can be represented in Haskell 98 form, so that we only have one representation.
    30   * TODO: more!
     30  * External Core originally parsed into a list of {{{TyClDecl}}} and a list of {{{IfaceBinding}}}. It now seems as though it might be better to replace the {{{IfaceBinding}}} with {{{LHsDecl}}}. This would require us to:
     31    * Add a new data constructor for {{{HsBind}}}: {{{data HsBind id = ... | CoreBind id (ExtCore id)}}}
     32    * Extend the renamer to rename {{{ExtCore RdrName}}} to {{{ExtCore Name}}}
     33    * Extend the type checker to typecheck {{{ExtCore Name}}} to generate {{{ExtCore Id}}}
     34    * Extend the desugarer to desugar {{{ExtCore Id}}} to {{{Core}}}
     35  * We probably want to represent all data types as GADTs, even if they can be represented in Haskell 98 form, so that we only have one representation.
    3136
    3237== Tasks ==
    3338
    34   * Define an external text representation for External Core (which will probably be simply a minor modification of the old format)
     39  * Define an external text representation for External Core (which will probably be simply a minor modification of the old format) (mostly  done?)
    3540  * Update the External Core data type to be compatible with the current Core data type. (mostly done)
    3641  * Update {{{PprExternalCore.lhs}}} to print stuff that {{{LexCore}}} and {{{ParserCore}}} can understand. (mostly done)
    3742  * Update {{{MkExternalCore.lhs}}} to support both the current Core and the new External Core. (mostly done)
    38   * Update {{{LexCore.hs}}}, {{{ParserCore.y}}}, and {{{ParserCoreUtils.hs}}} to support the new data type and external syntax.
     43  * Update the parser to recognize the new external syntax, generating an empty module at first. (partly done)
     44  * Update the parser to generate LHsBind rather than IfaceBinding
    3945  * Convert the current External Core documentation (in LaTeX) into a chapter (in XML) in the User's Guide.
    40 
    41 == Naming issues ==
    42 
    43 Since External Core was introduced, the {{{IfaceSyn}}} data type has changed. Originally (including in 6.6), it represented external name references using {{{IfaceExtName}}}. Now (in Darcs HEAD), it uses {{{Name}}} instead. This change leaves the External Core parser with the responsibility of generating a {{{Unique}}} for each name it encounters.
    4446
    4547== Miscellaneous notes ==