Images and Executables
ASDF program-op: with :build-operation "program-op", :build-pathname, and :entry-point in the system definition, run (asdf:make :my-app).
Other tools: Roswell (ros build), deploy (bundles foreign libraries for distribution), Buildapp, and LispWorks/Allegro delivery tools (tree shaking, smaller binaries).
Image-based development also means you can save a development image with all your libraries preloaded for instant startup (sbcl --core my.core).
;; SBCL: save the current Lisp image as a standalone executable
(defun main ()
(let ((args (uiop:command-line-arguments)))
(format t "Hello from a Lisp executable! Args: ~a~%" args)
(uiop:quit 0)))
(sb-ext:save-lisp-and-die "hello"
:toplevel #'main
:executable t
:compression t) ; compression requires SBCL built with zstd/zlib supportsbcl --non-interactive --load app.lisp --eval '(sb-ext:save-lisp-and-die "app" :toplevel #'"'"'main :executable t)'
./app foo bar