buildapp 是一个开源lisp项目, BSD 协议 把sbcl 的lisp 代码编译成独立可执行程序。可以把lisp 脚本编译成一个二进制的执行文件由于他需要把所有的引用到的package 都会混进去,还有sbcl 的imag
。所以出来的包有点大一个hellow-world 也有4,50m
安装:
sbcl(ql:quickload "buildapp")
(buildapp:build-buildapp)
windows 下就生成了 windows/system32/buildapp.exe
linux 下/usr/local/bin/buildapp
vim a.lisp
(defun main(argv)
(format t "hellow world"))
(main 1)
uildapp.exe --output hellow --load a.lisp --entry main C:\Windows\system32>buildapp.exe --output hellow --load a.lisp --entry maThis is experimental prerelease support for the Windows platform. useat your own risk. "Your Kitten of Death awaits!"This is experimental prerelease support for the Windows platform. useat your own risk. "Your Kitten of Death awaits!";; loading file #P"C:/Windows/system32/a.lisp"; file: C:/Windows/system32/a.lisp; in: DEFUN MAIN; (DEFUN MAIN (ARGV) (FORMAT T "hellow world")); --> PROGN SB-INT:NAMED-LAMBDA; ==>; #'(SB-INT:NAMED-LAMBDA MAIN; (ARGV); (BLOCK MAIN (FORMAT T "hellow world")));; caught STYLE-WARNING:; The variable ARGV is defined but never used.;; compilation unit finished; caught 1 STYLE-WARNING condition[undoing binding stack and other enclosing state... done][saving current Lisp image into hellow.exe:writing 2888 bytes from the read-only space at 0x22000000writing 1712 bytes from the static space at 0x22100000writing 27717632 bytes from the dynamic space at 0x22300000done]
C:\Windows\system32>hellow.exe
This is experimental prerelease support for the Windows platform. useat your own risk. "Your Kitten of Death awaits!
hellow world
C:\Windows\system32>
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/133735/viewspace-734067/,如需转载,请注明出处,否则将追究法律责任。