GHC code generation
In an exchange of ideas with a friend, this question arose: [[ I've been looking at GHC, and it looks like it has generates machine code directly rather than via C--. I know that Simon Peyton Jones (famous in the Haskell world) is one of the authors of C--, but I can find no direct connection between this and GHC or Haskell. Have you any idea where I might find this connection? ]] In my discussion with him, I had assumed that GHC generates code via C-- and a version of the GCC compiler (why else is GCC part of the GHC installation?). Can anyone shed any light or pointers? Thanks. #g ------------ Graham Klyne GK@NineByNine.org
There is no C-- backend for GHC (search the mailing list and you'll see Simon asking someone to try to do this :P). GHC either generates code by itself, or generates normal C code (with -fvia-c or -O2, iirc) and then uses GCC to compile this. On Wed, 10 Sep 2003, Graham Klyne wrote:
In an exchange of ideas with a friend, this question arose:
[[ I've been looking at GHC, and it looks like it has generates machine code directly rather than via C--. I know that Simon Peyton Jones (famous in the Haskell world) is one of the authors of C--, but I can find no direct connection between this and GHC or Haskell. Have you any idea where I might find this connection? ]]
In my discussion with him, I had assumed that GHC generates code via C-- and a version of the GCC compiler (why else is GCC part of the GHC installation?). Can anyone shed any light or pointers?
Thanks.
#g
------------ Graham Klyne GK@NineByNine.org
_______________________________________________ Haskell mailing list Haskell@haskell.org http://www.haskell.org/mailman/listinfo/haskell
-- -- Hal Daume III | hdaume@isi.edu "Arrest this man, he talks in maths." | www.isi.edu/~hdaume
There is no C-- backend for GHC (search the mailing list and you'll see Simon asking someone to try to do this :P). GHC either generates code by itself, or generates normal C code (with -fvia-c or -O2, iirc) and then uses GCC to compile this.
Ah... for some value of "normal"! It's very GCC-specific, and there is a nasty hack that it does to the output assembly code to rearrange function entry points so that the info table lives directly before the entry point. It's certainly not ANSI or C99 code. But it's not C-- either. --KW 8-)
participants (3)
-
Graham Klyne -
Hal Daume III -
Keith Wansbrough