Andrew Tolmach
Mon, 5 Feb 2001 10:30:54 -0800

Christoph Hermann <> wrote:
> Dear Haskellers,
> >>>>> "Simon" == Simon Peyton-Jones <> writes:
>     Simon>         We agreed that it would be a Jolly Good Thing if GHC
>     Simon> could be persuaded to produce GHC-independent Core output,
>     Simon> ready to feed into some other compiler.  For example,
>     Simon> Karl-Filip might be able to use it. ANDREW will write a
>     Simon> specification, and implement it.
> a good idea. Before ANDREW will put a lot of effort in the 
> specification
> and implementation, it would be good to have a discussion 
> about the core 
> representation that is gradually evolving. 

Indeed, I plan to publish a draft specification (quite soon) and
will be delighted to get feedback from the community before 
investing heavily in implementation.  I'm very glad to hear
that others are interested!

> There is the risk
> that the representation, made by insiders, will be too complicated
> to be used by several other people as I feel the core output
> currently produced by GHC is.

Actually, I am something of an outsider myself (though physically
located near a bunch of insiders just at the moment!) so I hope
I'll be sensitive to this point.  But perhaps Simon should not have
written "GHC-independent" Core output;  my goal is to
expose GHC's existing Core language, or something very close to it,
rather than to invent an ideal Core Haskell.  So some GHC-specific 
complexities may be unavoidable.

> It would be good to put all stuff related to this topic onto a
> WWW page, containing links to relevant papers, conventions,
> example pairs (Haskell source,core equivalent) which can be
> discussed. 

A good idea; I'll set up such a page and put the draft there to
get things started.  

> A toy interpreter (e.g., using happy) which 
> interprets the core language and which is written with the goal of 
> documentation, not under efficiency aspects, may be helpful.

Yes, I had already thought of doing this. Perhaps a type-checker too.

> I'm not sure whether you like the idea, but a quick solution for
> a small subset of Haskell would, in my opinion, be smarter
> to the user, since her or she can get used to the representation
> and we have something concrete to discuss. 

Well, yes.  But the entire core language *is* really fairly small, so I am
optimistic that a fairly complete job can be done in fairly short order.

 Andrew Tolmach