Comments on Building Common Lisp Executables

Post Comment

Héctor said:

You can greatly reduce the executable size when compiling with SBCL by adding

:compression t

to the following:

(sb-ext:save-lisp-and-die "hello" :executable t :toplevel #'main)
09 Apr 2023 04:59 GMT (#1 of 2 comments)

Susam Pal said:

Thank you, Héctor, for your comment! I updated the example program in this post as follows to test the compression feature:

(defun main ()
  (format t "hello, world~%"))
(sb-ext:save-lisp-and-die "hello" :executable t :compression t :toplevel #'main)

Indeed this created an executable that was only 8.1 MB in size whereas without compression the executable size is 35 MB.

10 Apr 2023 07:23 GMT (#2 of 2 comments)
Post Comment