[plt-scheme] LLVM

From: Eli Barzilay (eli at barzilay.org)
Date: Tue Jun 2 09:19:26 EDT 2009

On Jun  2, Tom Schouten wrote:
> I was wondering if there is anyone working on a bridge between
> LLVM and (PLT) Scheme.
> More specifically I'm thinking about run-time code generation
> (i.e. an embedded real-time DSL) and FFI to to the generated code.
> Also, what happened to the idea of using LLVM for the PLT JIT?

There were several problems with the project -- one was that LLVM is
huge, and adding it to PLT is roughly on the same scale as adding GCC.
After we've played with it for a while, Matthew did the mzscheme
jitter using lightning -- which is much more light weight, but also
(not surprisingly) leaves mzscheme with the burden of doing more
optimizations itself.  Having that done, there was little point in
continguing the fight with LLVM, which had a few other issues at the
time.  (My guess is that using LLVM would make things faster, given
the huge effort that went into making it an optimizing compiler.)

Implementing an LLVM interface, however, should be very easy -- after
spending some time looking at the various options, our conclusion was
that it's really just easier to invoke LLVM on whole files (in the
LLVM language), and using the LLVM jit to create an executable piece
of code.  The first instinct was to use the LLVM commands directly,
but that doesn't really have any advantage over using whole files.

          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                  http://www.barzilay.org/                 Maze is Life!

Posted on the users mailing list.