[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Wanted: Lua source code cruncher
- From: Ico Doornekamp <lua@...>
- Date: Sun, 9 Mar 2008 17:30:36 +0100
* On 2008-03-09 Louis Mamakos <email@example.com> wrote :
> > > With C, I can drastically reduce the size of the source code by using a
> > > cruncher utility: this reads in the C source and emits an equivalent but
> > > smaller source file by removing whitespace, comments, renaming locals to
> > > smaller versions, etc.
> > My lstrip does all that, except rename locals; but it's in C.
> why not just use luac? Perhaps that doesn't meet the original requirements somehow.
I believe the goal of the original poster is to reduce code size. My
experience is that compiled lua is not always that much smaller then the
original source (about 85%), and somtimes even bigger.
It is trivial to alter the lua sourcecode to allow transparent loading
of gzipped files by changing fopen/fread/getc into gzopen/gzread/gzetc
etc and linking to zlib. I have a patch for this lying around if anybody
is interested, this allows for reading of gzipped lua source- or bytecode.