3 ms·
With SBCL and Linux kernels with binfmt_misc support enabled (module or compiled) you can execute FASL file from command line, using the same SBCL core for all
by IronBacon 9y ago
With SBCL and Linux kernels with binfmt_misc support enabled (module or compiled) you can execute FASL file from command line, using the same SBCL core for all the executables and, I would add, with an "instantaneous" feel. ^__^
With Debian it should work out of the box, on other distributions it probably needs to register a wrapper/trampoline with the binfmt_misc infrastructure.
FWIK running instances don't share the same core in RAM though.
$ cat hello-world.lisp /tmp
(print "Hello. World!")
$ sbcl --noinform /tmp
* (compile-file "hello-world.lisp" :output-file "hello-world")
; compiling file "/tmp/hello-world.lisp" (written 23 AUG 2017 11:09:24 AM):
; compiling (PRINT "Hello. World!")
; /tmp/hello-world.fasl written
; compilation finished in 0:00:00.001
#P"/tmp/hello-world.fasl"
NIL
NIL
* %
$ chmod +x ./hello-world.fasl /tmp
$ ls -lh hello-world.fasl /tmp
-rwxr-xr-x 1 user user 330 Aug 23 11:17 hello-world.fasl*
$ time ./hello-world.fasl /tmp
"Hello. World!" ./hello-world.fasl 0.00s user 0.00s system 44% cpu 0.009 total
$ /tmp
Edit for clarifications and fixing formatting
- lottin 9y agoDidn't know that.