I have tried using LLVM as a JIT for Lua [0] (7 years ago), but found the codegen to be too slow [1] and use too much memory. It might have improved since then, but I really don't think it can compete with LuaJit's highly optimized tracing JIT.
Others [2] have also found LLVM to be unsuitable as a JIT.
I hadn't heard about that. I have been working on other projects, so haven't had the time to keep up with the developments in LLVM.
Thanks for the heads up.
The main issues I had with LLVM was the partly do to the memory usage. It can product very good machine code, but the time needed to JIT a block of code was sometimes longer then just running the it in the interpreter.
One of the features I like about Lua the most is the low resource overhead. LLVM was just too big for what I was looking for.
Usage LLVM to JIT/AOT compile Lua code was really just an experiment, something I wanted to try out.
I re-wrote [0] the llvm-lua project with a simple C code-gen backend for compiling Lua code to native code. Which is a bit more useful, since it is easier to cross-compile pure C code, then LLVM bitcode. A lot of the people that tried using llvm-lua wanted to cross-compile Lua code and embed it into an iOS application.
> I think the results speak for themselves and demonstrate unequivocally that LLVM is perfectly suitable for JIT compilation.