1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
| $ cat hello-world.lisp
(defun main ()
(write-line "hello world"))
$ cat Makefile
all:
sbcl --load hello-world.lisp --eval '(sb-ext:save-lisp-and-die "helloworld" :executable t :toplevel (function main))'
$ make
sbcl --load hello-world.lisp --eval '(sb-ext:save-lisp-and-die "helloworld" :executable t :toplevel (function main))'
This is SBCL 1.2.16, an implementation of ANSI Common Lisp.
More information about SBCL is available at <http://www.sbcl.org/>.
SBCL is free software, provided as is, with absolutely no warranty.
It is mostly in the public domain; some portions are provided under
BSD-style licenses. See the CREDITS and COPYING files in the
distribution for more information.
[undoing binding stack and other enclosing state... done]
[saving current Lisp image into helloworld:
writing 4944 bytes from the read-only space at 0x20000000
writing 3168 bytes from the static space at 0x20100000
writing 54132736 bytes from the dynamic space at 0x1000000000
done]
$ ./helloworld
hello world
$ file ./helloworld
./helloworld: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=462486e8d205b4a29cd303515b448a5a1d3ee7a1, stripped
$ ls -lh ./helloworld | awk '{print $5}'
52M |