GHC Extensibility

Brian Alliet brian at
Wed May 30 11:33:46 EDT 2007

On Wed, May 30, 2007 at 11:45:33AM -0300, Monique Monteiro wrote:
> simpler way to integrante new backends?  I worked at Haskell.NET
> project in the past, when we integrated successfully a .NET code
> generator to GHC 6.2.2.  

Do you have any documentation or papers or anything about your .NET
codegen? Is it the same (somewhat bitrotted) ILX codegen that exists in
the current GHC tree? I'm actually working on a new GHC backend too and
would be interested seeing yours.

> in GHC's code!  I haven't yet figured out how to call the .NET code
> generator from GHC 6.6.1's main function. 

You'll probably want to look at hscCompile in main/HscMain.lhs. From
there you can pick up either the Core, Core-Prepped, or STG
representation of the module and pass it off to your backend. If by
chance you want the C-- rep (although that probably won't be too useful
for a .NET backend) you'll want codeOutput in main/CodeOutput.lhs.


More information about the Glasgow-haskell-users mailing list