
On Tue, 2006-19-12 at 13:13 +0000, Simon Marlow wrote:
Is this me opening up a Pandora's Box of ignorance here? Or is LLVM potentially interesting? (And were someone motivated into perhaps trying to make an LLVM back-end, where would one start to poke around in, say, the GHC codebase to even begin to implement this? And how insane would they be driven by the process?)
Apologies for the slow reply. Actually I think this is a pretty cool idea (with a disclaimer that I know very nearly nothing about LLVM). Provided there are no serious gotchas, what you need to do is write a new backend for GHC that translates Cmm to LLVM. This should be pretty straightforward: for example, the Cmm->C code generator is only 1000 lines of Haskell:
http://darcs.haskell.org/ghc/compiler/cmm/PprC.hs
I hope LLVM lets you put data next to code, which is what GHC needs for its info tables. Also I hope it lets you fix global registers.
Well, I'm almost entirely ignorant of LLVM and of Haskell -- especially the internals of both. That makes me ideally suited for this project since I'm not aware that it's impossible. :D Do you mind, Simon, if, since I've pretty much decided that I want to tackle this, I pick your brains a lot for the Haskell internals side of the fence? -- Michael T. Richter Email: ttmrichter@gmail.com, mtr1966@hotpop.com MSN: ttmrichter@hotmail.com, mtr1966@hotmail.com; YIM: michael_richter_1966; AIM: YanJiahua1966; ICQ: 241960658; Jabber: mtr1966@jabber.cn "To [the Chinese], all other people are barbarians." --The Dalai Lama