[Openmcl-devel] llvm backend
dlw at itasoftware.com
Tue Mar 29 17:51:50 UTC 2011
Jason E. Aten wrote:
> Thanks guys. Those were some very interesting discussions to read
> through. I'm convinced that C is not such a great target,
While it certainly does have drawbacks, if you're thinking
about generating C, you might want to look at the
implementation techniques used by Gambit Scheme.
It emits C, but the C it emits has a whole lot of
C macros. Marc Feely gave a very interesting and
impressive talk about Gambit Scheme at the last
International Lisp Conference (Reno).
> and the Haskell implementers I think concluded the same (producing C--
> along the way).
In the summer of 2009 I asked Bryan O'Sullivan about the
issues of compiling Haskell into a virtual machine such
as LLVM. He told me that GHC implementors had looked
into this. An obvious plus is that you can take
advantage of LLVM's code generation (in JIT mode),
which I would think is very good, and, more important,
continually improving, which would be harder
to achieve with a less-widely-used language such as
Haskell. Like IronPython, the implementation could
"ride the wave" of the improving VM implementation.
However, Bryan said that the benefits of being able
to control things at the level of registers and being
able to fine-tune the stack frame format turned out
to be so important (for Haskell, anyway) that they
felt that even with the advantages of LLVM, they're
better off not using it. I was not expecting that answer.
I should point out that GHC is generally considered
to generate excellent code, which increases my
confidence that what they say about this is accurate.
The only things I can conclude are "it's hard to know
which is best" and "it depends on a lot of things".
More information about the Openmcl-devel