Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to reduce the size of a Clozure Common Lisp executable?

I saved this simple program

(defun hello-world ()
  (format t "Hello, world"))

(defun main ()
  (hello-world))

using ccl:save-application

(ccl:save-application "test"
                      :toplevel-function #'main
                      :prepend-kernel t
                      :purify t
                      :impurify t)

from the Clozure Common Lisp REPL.

The resulting executable has a size of 25M on Mac OS X. I understand that it contains the Lisp kernel and an in-memory representation of the Lisp system. Still 25M seems somewhat big for such a simple program. The parameters purify and impurify do not seem to have much of an effect.

What options do I have to reduce the size of the executable? Are there any?

like image 407
Jan Deinhard Avatar asked Jun 17 '12 20:06

Jan Deinhard


1 Answers

There is not much you can do with CCL.

One thing possible might be to create a smaller base image using a custom configuration by not recording various debug informations (arglists, documentation, source locations, ...).

You can also compress the executable and ship the compressed file.

CCL AFAIK lacks delivery tools to shrink the application - tools like those of Allegro CL and LispWorks.

like image 149
Rainer Joswig Avatar answered Nov 06 '22 14:11

Rainer Joswig