Progress on Ravi - a Lua 5.3 derivative
Dibyendu Majumdar
mobile@majumdar.org.uk
Thu Jan 1 00:00:00 GMT 2015
Hi
Ravi is a Lua 5.3 derived language with support for JIT compilation. I
started this project back in January this year - my aim was to see if
an alternative to LuaJIT was possible. LuaJIT is a very fast JIT
implementation for Lua - it uses trace compilation techniques to
achieve near C like performance even though Lua is a dynamic language.
As I wanted a relatively simple and easy to maintain JIT
implementation I decided from the outset that I was going to use
standard method based JIT. But this posed the problem that in a
dynamic language the JIT compilation only achieves a factor of 2 or 3
times improvement over the interpreter. To overcome this issue I opted
to add optional static types in Lua so that performance sensitive
operations - mainly to do with numeric values and arrays - could be
optimised.
My initial JIT implementation was based on LLVM. And now I am working
on a port of LLVM implementation to libgccjit. Thanks to the
simplicity of the implementation the port is estimated to be complete
by July (I started 2nd week of June). As of now several Lua/Ravi
bytecodes are implemented and I am able to run some of my performance
benchmarks.
I am pleased to say that libgccjit performance seems comparable to
LLVM so far. For details of the benchmarks please see:
http://the-ravi-programming-language.readthedocs.org/en/latest/ravi-benchmarks.html
The benchmark programs are:
https://github.com/dibyendumajumdar/ravi/blob/master/ravi-tests/fornum_test1.lua
https://github.com/dibyendumajumdar/ravi/blob/master/ravi-tests/fornum_test2.ravi
https://github.com/dibyendumajumdar/ravi/blob/master/ravi-tests/mandel1.ravi
The implementation falls back on the interpreter when it cannot JIT
compile a function.
For details regarding the status of libgccjit implementation please visit:
http://the-ravi-programming-language.readthedocs.org/en/latest/ravi-jit-libgccjit.html
I am grateful for all the support provided by Dave both on and off this forum.
Thanks and Regards
Dibyendu
More information about the Jit
mailing list