[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Java wrapper for LuaJIT?
- From: David Manura <dm.lua@...>
- Date: Mon, 17 Aug 2009 21:18:23 -0400
On Mon, Aug 17, 2009 at 3:08 PM, Kristofer Karlsson wrote:
> Kahlua does not generate bytecode, it's a plain bytecode interpreter.
> I also doubt it benefits much from the JIT, it would be very hard for it to
> optimize for it or do any sort of predictions.
>
> Still, my own benchmarks (possibly not fair or measuring the right thing)
> show it to be about the same speed as LuaJ, much faster than MiniJoe,
> Groovy, Cajuscript and Rhino, and about 30 times slower than plain Java.
The list of known Lua implementations in Java are in [1].
Perhaps yet another way to go about this is to translate Lua code into
Lua API code (like lua2c) or Lua bytecode (like luac2c) or maybe even
LuaJIT2 bytecode, but instead of binding it to C Lua, bind it to one
of the Java implementations of Lua. I've heard that Mochalua is
"(slavishly) true to the C API" [2]. If so, it shouldn't be much work
to patch lua2c to work with Mochalua, for example. However, see
"limitations" (e.g. coroutines).
[1] http://lua-users.org/wiki/LuaImplementations
[2] http://lua-users.org/lists/lua-l/2008-11/msg00319.html