[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: LuaJIT2 and lua_dump()
- From: Joshua Jensen <jjensen@...>
- Date: Tue, 02 Mar 2010 08:31:27 -0700
----- Original Message -----
From: Mike Pall
Date: 3/2/2010 6:36 AM
I don't use LuaJIT at this time, so this isn't immediately important for
me right now, but...
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:
Loading a raw chunk of data and running some "fix-ups" will always be
far faster than parsing text data and compiling it into its appropriate
form. Additionally, fragmentation of memory will be kept at a minimum
as parsers almost always need scratch space. The Lua parser does, anyway.
- The parser is quite fast, so you wouldn't gain much.
Among other things, I use Lua as a data format. It is not uncommon to
have a 100 megabyte text .lua file. I'm looking at one right now where
the text format is 134 megabytes, and the binary format is 26 megabytes.
- 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.
It works for code, too. I just tested running luac on a 15k .lua ASCII
script. It ended up being 7k in binary form.