RE: How to generate C-- inside an Haskell program
"Simon Peyton-Jones" <[email protected]> Tue, 13 Sep 2005 13:11:38 +0100
| Newsgroups | gmane.comp.lang.c-- |
|---|---|
| Message-ID | <036EAC76E7F5EC4996A3B3C3657D4116032D445C@EUR-MSG-21.europe.corp.microsoft.com> |
Alain The relevant modules are all in the directory ghc/compiler/cmm/ They are just slightly specialised towards GHC (e.g. the global registers are a GHC-specific algebraic data types). But they are currently not packaged as a stand-alone library; I have only built them as part of GHC itself. (Making a stand-alone Haskell library to support C-- would be a good thing.) No documentation I fear, except what is in the code. Examples of use... well, you can look at the modules that import these cmm modules I guess. If you'll be at ICFP we could talk more there. Simon | -----Original Message----- | From: Alain Cremieux [mailto:[email protected]] | Sent: 10 September 2005 22:43 | To: [email protected] | Subject: How to generate C-- inside an Haskell program | | Hi, | I am taking the opportunity of some movements on the mailing-list to ask | this question. | | I have translated Paul Govereau's Tiger compiler from O'Caml to Haskell | (and Haskell's tools, Alex and Happy). It works and produces roughly the | same C-- output as the original. | In this compiler, the C-- code is produced simply by writing code to a file. | Now I would like to generate C-- using modules which have probably been | developped in the (unfinished) part of GHC dealing with C--. Is there | any documentation about these modules, or are there some examples | available in the CVS tree that I can take as models ? | Thanks, | Alain