[Haskell-cafe] LLVM back end

Kenneth Hoste kenneth.hoste at ugent.be
Mon Nov 20 03:29:16 EST 2006


On 20 Nov 2006, at 08:27, Michael T. Richter wrote:

> I've been eyeing LLVM[1] as interesting technology -- brief  
> executive summary: a virtual machine suited as the back end of  
> compiler output with optimised native code then coming from it as  
> either JIT-based execution of the LLVM bytecode or as a further  
> compilation step -- and couldn't help but immediately think of the  
> possibility of one of the Haskell compiler projects providing an  
> LLVM code generator.  I think this would help in several areas:
> it could make porting the compiler to other architectures --  
> including oddball ones that would be too small to otherwise support  
> -- easier;
> it could help remove the nigh-ubiquitous reliance upon GCC as a  
> back-end (while I think that GCC is a pretty good piece of  
> software, I'm not sure it's really suited to its current role as  
> the "do-everything" back end);
> it could leverage some of the really interesting work that's going  
> on in optimisation technology by letting one VM's optimiser do the  
> work for any number of languages;
> it could improve interaction between source code written in  
> multiple languages.
>
> 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?)

I've been looking at LLVM for a while too now, for research purposes.  
And one of the big downsides (at least for me), is the lack of a real  
simulator which mimicks the virtual machine. They do have a JIT  
compiler which allows you to execute LLVM bytecode on a number of  
platforms, but I'm interested in analyzing the dynamic behaviour of  
the LLVM bytecode, and JIT'ing doesn''t allow that. They also have an  
interpreter, which is probably quite similar to a simulator, but  
that's just horrible slow because of the SSA (hence, no registers)  
system used.

To get to the point: I think Haskell might be a great candidate for  
building an LLVM bytecode simulator. I have been thinking about it,  
but because of my lack of coding experience (and understanding of  
Monads), I haven't started a project yet. If some people would be  
interested in such a thing though, we might join to make this a  
succes. I'm not LLVM expert, and surely no Haskell expert either, but  
I think such a project can be pretty interesting.

greetings,

Kenneth

-- 

Statistics are like a bikini. What they reveal is suggestive, but  
what they conceal is vital (Aaron Levenstein)

Kenneth Hoste
ELIS - Ghent University
kenneth.hoste at elis.ugent.be
http://www.elis.ugent.be/~kehoste




More information about the Haskell-Cafe mailing list