Posted on 2005-07-06 in Lisp
I did a small proof-of-concept tree shaker for SBCL. It doesn't do much, and it's not very good at what little it does. In the following transcript we create a scandalously small core that actually does something useful (gzip compression with Salza).
% /opt/packages/sbcl/0.9.1.2.gc1/bin/sbcl --noinform --userinit /dev/null
* (load "gzip.lisp")
T
* (load "shake.lisp")
T
* (shake-lisp-and-die "gzip.core" #'gzip::main)
[doing purification: roots handlers stack bindings static cleanup done]
[undoing binding stack and other enclosing state... done]
[saving current Lisp image into /tmp/gzip.core:
writing 7255536 bytes from the read-only space at 0x01000000
writing 4643256 bytes from the static space at 0x05000000
writing 4096 bytes from the dynamic space at 0x09000000
done]
% ls -l gzip.gz gzip.lisp gzip.core
ls: gzip.gz: No such file or directory
-rw-r--r-- 1 jusnel 11911168 Jul 6 06:02 gzip.core
-rw-r--r-- 1 jusnel 3195 Jul 6 05:45 gzip.lisp
% /opt/packages/sbcl/0.9.1.2.gc1/bin/sbcl --core gzip.core --noinform gzip.lisp
% ls -l gzip.gz
-rw-r--r-- 1 jusnel 1276 Jul 6 06:03 gzip.gz
/bin/gzip is a bit under 60kB, so we only lose by a factor of 200!

Can i please see the code ? where do i look for it ? is that possible?
juan.c.olarte"at"gmail.com