lua-users home
lua-l archive

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

* On 2008-03-09 Louis Mamakos <> 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.