lua-users home
lua-l archive

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

----- Original Message -----
From: Mike Pall
Date: 3/2/2010 6:36 AM
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:
I don't use LuaJIT at this time, so this isn't immediately important for me right now, but...
- The parser is quite fast, so you wouldn't gain much.
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.
- 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.
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.

It works for code, too. I just tested running luac on a 15k .lua ASCII script. It ended up being 7k in binary form.