X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=utils%2Fext-core%2FREADME;h=4fb16ffcf2dfb1260a6faa76515a853fbcec9a8a;hp=6b8168d25b07b6d4e21acbc6c7a1637c15e9ef8d;hb=10704b34c1928dde3d0ef33fe37c3eb7b948975f;hpb=276585028d51a2516a31b91a91a1f4bba5c9f8ba diff --git a/utils/ext-core/README b/utils/ext-core/README index 6b8168d..4fb16ff 100644 --- a/utils/ext-core/README +++ b/utils/ext-core/README @@ -2,10 +2,50 @@ A set of example programs for handling external core format. In particular, typechecker and interpreter give a precise semantics. -All can be built using, e.g., +To build, run "make". +--------------------- +tjc April 2008: -happy -o Parser.hs Parser.y -ghc --make -package text -fglasgow-exts -o Driver Driver.hs +==== Notes ==== + +The checker should work on most programs. Bugs I'm aware of: +1. There's some business I don't quite understand involving + coercions and subkinding (for details, see: + http://www.haskell.org/pipermail/cvs-ghc/2008-April/041949.html) + This shows up when typechecking a few of the library modules. + +2. There's some weirdness involving funny character literals. This can + be fixed by writing a new lexer for chars rather than using Parsec's + built-in charLiteral lexer. But I haven't done that. + +3. When typechecking the ghc-prim:GHC.PrimopWrappers library module, + some declarations seem to have the wrong type signature (due to + confusion between (forall (t::*) ...) and (forall (t::?) ...).) + This may be a GHC bug. + +Typechecking all the GHC libraries eats about a gig of heap and takes a +long time. I blame Parsec. (Someone who was bored, or understood happy +better than I do, could update the old happy parser, which is still in the +repo.) + +The interpreter is not working yet. + +==== Building ==== + +To run the checker and interpreter, you need to generate External Core +for all the base, integer and ghc-prim libraries. This can be done by +adding "-fext-core" to the GhcLibHcOpts in your build.mk file, then +running "make" under libraries/. + +Then you need to edit Driver.hs and change "baseDir" to point to your GHC +libraries directory. + +Once you've done that: +1. make prims (to generate the primops file) +2. make +3. make nofibtest (to run the parser/checker on all nofib programs... + for example.) + +Tested with GHC 6.8.2. I make no claims of portability. -Most recently tested with GHC 6.8.1. I make no claims of portability. --tjc