Changes between Version 6 and Version 7 of ExternalCore
- Timestamp:
- 11/07/06 12:08:21 (7 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
ExternalCore
v6 v7 3 3 The {{{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. 4 4 5 Once the process is finished, this page will just describe the design. 5 6 6 7 == Relevant files == … … 25 26 * [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. 26 27 27 == Design decisions ==28 == Design changes == 28 29 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. 31 36 32 37 == Tasks == 33 38 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?) 35 40 * Update the External Core data type to be compatible with the current Core data type. (mostly done) 36 41 * Update {{{PprExternalCore.lhs}}} to print stuff that {{{LexCore}}} and {{{ParserCore}}} can understand. (mostly done) 37 42 * 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 39 45 * 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.44 46 45 47 == Miscellaneous notes ==
