haskell-llvm An LLVVN backend for DDC
Erik de Castro Lopo
mle+hs at mega-nerd.com
Wed Jun 23 19:13:32 EDT 2010
Hi all,
I do a some hacking on Ben Lippmeier's DDC compiler:
http://trac.haskell.org/ddc/wiki/WikiStart
and with Ben's blessing, I'm interested in adding an LLVM backend which
we hope will eventually replace the existing C backend.
The main goal of this exercise is to generate object files via LLVM
which are link compatible with the object files generated by the
current C backend (this should help with validation, debugging and
sanity checking).
Longer term we also want to be able to boostrap the compiler, port
it to other platforms and architectures and enable the creation of
cross compilers, so we don't want to do anything that will make any
of these things more difficult than it is with the current C backend.
I have read David Terei and Manuel Chakravarty's paper 'An LLVM backend for
GHC', I have looked at the haskell llvm bindings (and the example programs)
and read up on LLVM itself.
Currently, I'm leaning towards using the haskell LLVM bindings to generate
platform independent LLVM bytecode files and then use the llc tool (part of
LLVM) to convert the bytecode files to native assembler which would then be
assembled into an object file use the system assember (GNU as on Linux, Mac
OSX and Freebsd, the only platforms we currently support).
The question for the people who have more experience in this area than me
is, does this seem like a sane and rational plan? Does anyone have any
pointers ot tips?
Cheers,
Erik
--
----------------------------------------------------------------------
Erik de Castro Lopo
http://www.mega-nerd.com/
More information about the Haskell-llvm
mailing list