[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Wanted: Lua source code cruncher
- From: Chris Marrin <chris@...>
- Date: Sun, 9 Mar 2008 08:32:26 -0700
On Mar 9, 2008, at 8:20 AM, David Given wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Luiz Henrique de Figueiredo wrote:
With C, I can drastically reduce the size of the source code by
cruncher utility: this reads in the C source and emits an
smaller source file by removing whitespace, comments, renaming
smaller versions, etc.
My lstrip does all that, except rename locals; but it's in C.
Unfortunately lstrip isn't suitable for me, but looking it up on
led me to LuaSrcDiet, which does pretty much what I want (...except
locals); so thanks anyway.
Runing LuaSrcDiet on pm reduces it down to 58%, which isn't bad.
Unfortunately, once this is bolted on to the Lua interpreter source
itself, this turns into a real reduction of the resulting binary to
- --- which is barely worth measuring.
Local renaming would improve that no end, as I tend to use fairly long
variable names, but I suspect what I really need is a better C
It ought to be possible to Huffman encode all symbol names by creative
use of #define. Hmm...
I'm not sure of the nature of your app, but maybe it would be easier
to just compress your Lua source using gzip and then use gzio or
something to uncompress it? Gzip does a great job of compressing
things like long variable names which repeat throughout the text. You
may still want to get rid of comments to get maximum compression,