Progress on Ravi - a Lua 5.3 derivative
David Malcolm
dmalcolm@redhat.com
Thu Jan 1 00:00:00 GMT 2015
On Sun, 2015-06-28 at 21:12 +0100, Dibyendu Majumdar wrote:
> 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
Thanks for posting this.
If I may be so bold, the benchmark table isn't quite apples-to-apples:
it has gccjit running in a guest vm, but everything else running on bare
metal, putting gccjit at a slight disadvantage. Currently a reader has
to make it down to the final bullet point to see that. Is it possible
to emphasize that a bit? (e.g. change the table header to read "Ravi
(gccjit; guest vm)".
FWIW, it might be worth stating the versions of LLVM and gccjit in use.
Hope this is constructive
Dave
More information about the Jit
mailing list