[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Wanted: Lua source code cruncher
- From: KHMan <keinhong@...>
- Date: Mon, 10 Mar 2008 11:02:12 +0800
Tony Finch wrote:
> On Sun, 9 Mar 2008, David Given wrote:
>> I've got this build tool of which you have heard me speak before, Prime
>> Mover. It ships a small but reasonably verbose Lua program as part of
>> its binary. As it makes no sense to ship comments in a binary, I'd
>> rather like to make this smaller.
>
> Compile it with luac -s and compress the result. I've attached some
> utility code for loading Lua chunks (source or compiled, since Lua doesn't
> care) that have been compressed in zlib or gzip format. I also have a
> little deflate utility for making zlib format files, which are a few bytes
> shorter than gzip.
>
> This is probably only a win if your app is dynamically linked to Lua,
> since you'd need quite a lot of Lua code to get near the size of liblua.a
> (200K on my machine).
For completeness, yet another alternative that is simpler for
self-contained executables (more popular on Win32) is embedding
source or binary chunks and compressing it. With UPX, UCL-max is
about gzip-6, plus new versions of UPX has LZMA, suitable for
contemporary desktop machines. For the developer, no extra code
needs to be written.
--
Cheers,
Kein-Hong Man (esq.)
Kuala Lumpur, Malaysia