[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: LuaJIT and bytecode
- From: Axel Kittenberger <axkibe@...>
- Date: Sun, 4 Dec 2011 19:29:09 +0100
Because vanilla Lua and LuaJIT work very differently. One is a
register based virtual machine, the other translates to assembler for
Lua source to Lua bytecode compilation loses some information about
the code structure. Nothing that the Lua VM would need, since it only
executed the code, but LuaJIT uses that information.
Does LuaJIT even use another bytecode format? I always thought it
would translate source directly into assembler.
On Sun, Dec 4, 2011 at 6:53 PM, Antonio Scuri <firstname.lastname@example.org> wrote:
>> Couldn't you just embed the Lua source code instead?
> Yes, that's also an option and my next question. But I would like to
> understand better that incompatibility.
>> -----Original Message-----
>> From: Miles Bader [mailto:email@example.com]
>> Sent: domingo, 4 de dezembro de 2011 03:44
>> To: Antonio Scuri
>> Cc: Lua mailing list
>> Subject: Re: LuaJIT and bytecode
>> "Antonio Scuri" <firstname.lastname@example.org> writes:
>> > In some libraries we embed Lua code using "luac.exe" then "bin2c.lua".
>> > This seems to be incompatible with LuaJIT and I would like to
>> > understand a little bit more about that.
>> Luajit uses a different bytecode format.
>> Couldn't you just embed the Lua source code instead? It works with
>> anything, and seems even easier to handle than bytecode.
>> [Maybe using source code would be undesirable for a super-tiny embedded
>> app, which wouldn't want the extra size of the compiler, but if you're
>> luajit that suggests this isn't your case.]
>> Run away! Run away!