[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: LuaJIT2 and lua_dump()
- From: Lawrie Nichols <lawrien@...>
- Date: Tue, 02 Mar 2010 15:00:16 +0000
On 02/03/10 13:36, Mike Pall wrote:
Lawrie Nichols wrote:
I notice that in the current LuaJIT2 beta (pulled from git this
morning), the lua_dump() function is effectively a noop. Is this
something that will be implemented in the future, or is there an
underlying issue that prevents the implmentation of this function ?
Bytecode loading/saving is not a priority right now:
- The bytecode format itself is still in flux during the betas.
- It won't be compatible with Lua's bytecode in any case.
Thanks for the swift response. Basically, I'm using lua_dump() and
lua_load() to allow serialization of data between multiple lua states
via memory buffers, so currently the bytecode format (and it's
compatibility with standard Lua) is not really an issue for me....maybe
further down the line it might be, if lua states are running in separate
processes and I need to serialize via sockets though.
- The parser is quite fast, so you wouldn't gain much.
- Hiding the source code is not an issue for open source
developers. So far, no closed source developer has asked for
this feature and was also willing to cover the development costs.
In this instance, my need is purely to dump a lua function in one state
and the load it in another state - this will be a mechanism for
temporary memory persistence - not obsfucation.
There are more pressing issues right now, so I'd need to hear some
really good arguments before starting to work on it.
--Mike
I did have a look around the source for LuaJIT2, thinking that maybe
this was something I might be able to contribute back to the project,
but to be honest it was way over my level of understanding :-(
I appreciate that loading/saving is not necessarily high on the priority
list at the moment, and there are only two (maybe somewhat dubious)
arguments I can make for it's inclusion:
* Lua currently supports it (I know, a bit lame);
* there is currently no other API available for passing lua functions
around between different Lua states
Lawrie