lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Mon, Nov 2, 2009 at 6:39 PM, Mark Hamburg wrote:
> To what extent did you change the instruction set v to what extent did you
> change the encoding of the instruction set? (I'm thinking about whether a
> bytecode translator is even reasonable to consider.)

Here's a test of running Lua 5.1 bytecodes on LuaJIT2 via LuLu [1]

$ time ../LuaJIT-2.0.0-beta1/src/luajit.exe lulu.lua luac.out 24
~ 1.3 s

$ time ../lua-5.1.4/src/lua lulu.lua luac.out 24
~ 6.6 s

$ time ../lua-5.1.4/src/lua luac.out 24
~ 0.1 s

To run this in LuaJIT2, do a "luac test/fib.lua" and make the
following edit to lulu.lua:

  -   local chunk = string.dump(loadfile(arg[1]))
  +   local chunk = io.open(arg[1], 'rb'):read'*a'
--string.dump(loadfile(arg[1]))

(BTW, for whatever reason, a compiled life.lua runs under lulu under
Lua 5.1 but not under LuaJIT2.)

[1] http://lulu.luaforge.net/