web-dev-qa-db-ja.com

Common LISPを実行可能ファイルにコンパイルする

最近、SBCLを使用してCommon LISPの学習を始めました。 LISPプログラムをWindowsバイナリにコンパイルするにはどうすればよいですか?

33
Shenal Silva

Hello.exeの作成:

* (defun main () (print "hello"))

MAIN
* (sb-ext:save-LISP-and-die "hello.exe" :toplevel #'main :executable t)
[undoing binding stack and other enclosing state... done]
[saving current LISP image into hello.exe:
writing 3160 bytes from the read-only space at 0x22000000
writing 2592 bytes from the static space at 0x22100000
writing 30134272 bytes from the dynamic space at 0x22300000
done]
> dir hello.exe
31,457,304 hello.exe
> hello.exe

"hello"

31 MBの実行可能ファイル!

27
KIM Taegyoon

使用する SB-EXT:SAVE-LISP-AND-DIE。詳細は http://www.sbcl.org/manual/#Saving-a-Core-Image を参照してください。

12
Anton Kovalenko

それを行うためのいくつかのツールがあります。 Buildapp で始めることができます。

8
(defun main ()
    (format t "Hello, world!~%"))

(sb-ext:save-LISP-and-die "hello-world.exe"
:executable t
:toplevel 'main)
4
zxt