From: Peter Van Eynde
Subject: Re: Compiling Executables
Date: 
Message-ID: <slrn74lfap.buu.pvaneynd@mail.inthan.be>
On 11 Nov 1998 19:46:43 -0500, Sam Steingold wrote:
> >> I'm using CLISP on Linux.
>
>1. compile your lisp files (clisp -c myfile.lsp)
>2. start fresh clisp, then dump it:
>$ clisp
>> (load "myfile")
>> (lisp:saveinitmem "myimage.mem" :init-function #'mymain :quiet t)
>> (quit)
>$
>
>now when you run clisp as
>
>$ lisp.run -M myimage.mem

With linux 2.1 and higher there is another alternative:
use the binmisc system to register a stub-executable as a 
shell for .x86f and .lisp files.

This can be done with:

echo ':lisp:E::x86f::/usr/bin/lisp-start:'  > /proc/sys/fs/binfmt_misc/register
echo ':lisp:E::lisp::/usr/bin/lisp-start:'  > /proc/sys/fs/binfmt_misc/register

And having /usr/bin/lisp-start:

#!/bin/sh
/usr/bin/lisp -load $1

Of course, using the multiprocessing extensions of CMUCL and using it as a
daemon you could setup a lisp-server that executes the program for 
you (this would reduce the startup-time but also reduce security).

Demo file: 

(in-package :user)

(format t "THIS A A HUGE SECURITY RISC. CHANGE THE PASSWORD!!!~%~%")
(setf mp::*idle-process* mp::*initial-process*)
(mp::start-lisp-connection-listener :port 6789 :password "Clara")

;;; now you can telnet in and do:
#|
$telnet localhost 6789
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
Enter password: "Clara"

CMU Common Lisp Experimental 18a+ release x86-linux 2.4.7 
                      6 November 1998 cvs, running on slartibartfast
Send bug reports and questions to your local CMU CL maintainer, 
or to ········@debian.org
or to ··········@cons.org. (prefered)

type (help) for help, (quit) to exit, and (demo) to see the demos

Loaded subsystems:
    Python 1.0, target Intel x86
    CLOS based on PCL version:  September 16 92 PCL (f)
* (+ 1 1)

2
* (quit)
Connection closed by foreign host.
|#

Getting it to run the file is a SMOP. :-)

Groetjes, Peter

--
It's logic Jim, but not as we know it.  ········@debian.org, ········@inthan.be
Look in keyservers for PGP key.