Modifying GHC to accept external Styx code

Mark Alexander Wotton mwotton@cse.unsw.EDU.AU
Tue, 4 Feb 2003 09:19:17 +1100 (EST)

On Mon, 3 Feb 2003, Simon Peyton-Jones wrote:

> | I want to use GHC as a backend for my experimental compiler.
> | I'm trying to modify it to accept styx code from my compiler, and I'm
> | having some trouble working out where I need to make changes. In
> truth,
> | GHC is more haskell code than I've ever seen before in one place, and
> I'm
> | a bit lost: can anyone suggest which modules I should become familiar
> with
> | and which I should leave alone?
> You don't say what 'styx code' is.  My advice:  either translate styx to
> Haskell, or to External Core.  (Probably the latter.)  GHC can read both
> of these in without modification.
> External Core is a typed lambda calculus.

Yes, I know External Core: I'm using it as my input language. (GHC is my
frontend as well.) The optimisation algorithms I want to implement need
a lower-level language than Core, which is why I want to use Styx, the
native generation intermediate language. Abstract C is also an option, but
if I've got to hack GHC to get either of them going, I'd rather do it for


no-one takes up music to play their own instrument
	-- Randy Hiatt, Chalkhills list