external core

John Meacham john at repetae.net
Thu Jul 28 20:58:45 EDT 2005

Of course, I'd like to see a core based on pure type systems and the
lambda cube rather than system F :) but I can make do. pretty much all
of jhc's constructs that come from haskell code can directly map to ghc
core, however my implementation of type classes would require creating a
datatype that exactly mirrors the type hierarchy and turn each typelike
lambda in jhc into a type "lambda" and a data lambda in ghc core (and
typelike applications similarly modified). 

I found the main difficulty in trying to use ghc's core from other
systems was not the core itself, but rather a 'primitive operation
impeadance mismatch', ghc defines a whole lot of primitives, jhc has
almost none.  everything but the most basic numerical operations is
imported via the FFI (and I am coming up with a foreign syntax to get
rid of those too, the goal being every in scope name is declared in
haskell source, one way or another) and it is up to the compiler to make
FFI calls fast. my current plan is to create a 'foreign ghc primitive'
decl for jhc which will let me import and use ghc primitives when using
the ghc backend. some low level stuff in the built-in libraries will
have to change, but it is no worse than porting to a new OS interface.


John Meacham - ⑆repetae.net⑆john⑈ 

More information about the Libraries mailing list