Improve External Core syntax for newtypes
[ghc-hetmet.git] / utils / ext-core / README
1 A set of example programs for handling external core format.
2
3 In particular, typechecker and interpreter give a precise semantics.
4
5 To build, run "make".
6 ---------------------
7 tjc April 2008:
8
9 ==== Notes ====
10
11 The checker should work on most programs. Bugs I'm aware of:
12 1. There's some business I don't quite understand involving
13    coercions and subkinding (for details, see:
14    http://www.haskell.org/pipermail/cvs-ghc/2008-April/041949.html)
15    This shows up when typechecking a few of the library modules.
16    
17 2. There's some weirdness involving funny character literals. This can
18    be fixed by writing a new lexer for chars rather than using Parsec's
19    built-in charLiteral lexer. But I haven't done that.
20
21 3. When typechecking the ghc-prim:GHC.PrimopWrappers library module,
22    some declarations seem to have the wrong type signature (due to 
23    confusion between (forall (t::*) ...) and (forall (t::?) ...).)
24    This may be a GHC bug.
25
26 Typechecking all the GHC libraries eats about a gig of heap and takes a
27 long time. I blame Parsec. (Someone who was bored, or understood happy
28 better than I do, could update the old happy parser, which is still in the
29 repo.)
30
31 The interpreter is not working yet.
32
33 ==== Building ====
34
35 To run the checker and interpreter, you need to generate External Core
36 for all the base, integer and ghc-prim libraries. This can be done by
37 adding "-fext-core" to the GhcLibHcOpts in your build.mk file, then
38 running "make" under libraries/.
39
40 Then you need to edit Driver.hs and change "baseDir" to point to your GHC
41 libraries directory.
42
43 Once you've done that:
44 1. make prims (to generate the primops file)
45 2. make
46 3. make nofibtest (to run the parser/checker on all nofib programs...
47    for example.)
48
49 Tested with GHC 6.8.2. I make no claims of portability.
50
51