[Haskell-cafe] Re: [Haskell] ANNOUNCE: GHC survey results

Malcolm Wallace Malcolm.Wallace at cs.york.ac.uk
Thu Jun 30 06:09:30 EDT 2005


"Simon Peyton-Jones" <simonpj at microsoft.com> writes:

> | If anything I would like to see the Haskell community produce a Haskell
> | front end which was compiler neutral. That would facilitate many
> | interesting projects, and that might even help with the need to support
> | new extensions as they come along. There are already some candidates
> | floating around, but it seems they are not widely adopted.
> 
> Well, "ghc -c -fext-core Foo.hs" is a Haskell front end that produces
> System F code ("External Core"), in a file Foo.hcr.  I'm not sure
> whether that was what you meant.

External Core is great for some purposes - if you want to play
with new optimisation techniques for instance.  A tracing system
like Hat however wants to have lots of direct linkage back to the
original source code.  External core doesn't bear a terribly close
resemblence to the source - it would require a significant amount
of re-sugaring for presentation to the user of Hat.  It also loses
the actual location of expressions (line/column), although perhaps
GHC-as-library would be better in this respect.

The ideal front-end for a syntax-directed tool like Hat consists solely
of a lexer/parser to an abstract syntax tree, with no desugaring
whatsoever, and no typechecking.  This is essentially what we have
at the moment, but based on nhc98's front-end.  For better coverage
of language extensions, ghc's parser might be preferable.  One can
imagine that other tools would want to plug into the pipeline at
differents points (after desugaring but before type-checking; after
type-checking; etc.)

Regards,
    Malcolm


More information about the Haskell-Cafe mailing list