Subject: Re: Executables: Why all the abuse?
From: (Rob Warnock)
Date: Tue, 03 Feb 2004 06:03:54 -0600
Newsgroups: comp.lang.lisp
Message-ID: <>
Rayiner Hashem <> wrote:
| ... If CMUCL spit out a small binary that
| linked with "" or "cmucl.dll" end-user Lisp apps would
| become much more palatable. It doesn't matter if the binary is 500KB
| but libcmucl.dll is 11.5MB --- the difference in perception is huge.

Done. All you need is a CMUCL core image with a "#!" reader macro
that acts like a comment, then concatenate the following onto the
front of your FASL files (as noted):

  ;;;; Hack to allow CMUCL FASL files to run as shell scripts.
  ;;;; Usage: cat {this_file} foo1.x86f ... fooN.x86f > foo ; chmod +x foo
  ;;;; The last "fooN.x86f" should have a top-level form which starts the app.
  (let* ((my-name (second *command-line-strings*))
	 (stream (open *script-name* :element-type '(unsigned-byte 8))))
    (dotimes (i 9) (read-line stream)) ; Eat header text from stream, then
    (load stream :contents :binary)    ;   pass rest to FASLOAD.
    (continue))   ; Keep LOAD of script from falling into FASL file(s).

The "" is actually two files, a small executable (".../bin/lisp")
and a larger core file (".../lib/cmucl/lib/lisp.core"), but the point is
that it would be shared by all of the "executables" you deliver.


Rob Warnock			<>
627 26th Avenue			<URL:>
San Mateo, CA 94403		(650)572-2607