Any experiemnts/evaluations on LLVM and graph rewriting (term-rewriting) systems?

Hi,

are there any attempts to use LLVM in graph-rewriting (term-rewriting) language implementations?

How good is LLVM for this?

E.g., is it natural to expect that the LLVM-based implementation of the language Concurrent Clean be any faster than its reference implementation?

Best regards

Valery Khamenya wrote:

are there any attempts to use LLVM in graph-rewriting (term-rewriting)
language implementations?

Pure is a dynamically typed FPL based on term rewriting:

http://pure-lang.googlecode.com/

It uses the LLVM JIT to compile and execute code on the fly in an
interpreter-like environment, and can also batch-compile code to native
executables. This includes the deterministic (non-backtracking) tree
matching automata needed to implement general term rewriting in an
efficient manner.

How good is LLVM for this?

There haven't been any other implementations of Pure compilers so that I
can't give you a real comparison. What I can say with confidence is that
LLVM made developing a code generator for Pure very convenient, because
of the readily available optimization passes, cross-platform support and
the integrated JIT.

E.g., is it natural to expect that the LLVM-based implementation of the
language Concurrent Clean be any faster than its reference implementation?

You should probably get in touch with David Terei. His LLVM ghc backend
seems to be doing fairly well:
http://donsbot.wordpress.com/2010/02/21/smoking-fast-haskell-code-using-ghcs-new-llvm-codegen/

Albert

Hallo Albert,

thanks!

best regards

Hi Valery

are there any attempts to use LLVM in graph-rewriting (term-rewriting)
language implementations?

I've added a new LLVM backend to the ghc Haskell compiler.

How good is LLVM for this?

Works very well. I'm operating from the low levels of the ghc compiler
though where I don't need to deal with the complexity of compiling a
functional language. The input to my backend is an intermediate
language called 'Cmm' that basically a lower level C like language.

I've written a new paper about my experiences using LLVM with my
supervisor, Manuel Chakravarty that I'll be presenting in a few weeks
at the Haskell Symposium. You can grab it here:
http://www.cse.unsw.edu.au/~davidt/papers.html

Cheers,
David

Hi David,

interesting paper (I used the direct address http://www.cse.unsw.edu.au/~davidt/downloads/ghc-llvm-hs10.pdf )

I like LLVM and enjoyed a lot playing with Concurrent Clean.
So, I hope developers of Concurrent Clean will be interested in merging of both things.

best regards