With C or Fortran you make an executable which can be run from the Linux
shell.
How can you make a Lisp executable? What are the alternatives to always
having
to go into the lisp interactive environment and working there?
Simple example: suppose I want a Lisp program to write out a data file
which is used by
another program (written in Fortran say) and I want to just write a
shell script that runs
the Lisp program and then the Fortran program... How can this be done?
Also, I was reading about Paul Graham's program ViaWeb (see Paul
Graham's
website) which is basically a program run on a server which a client can
use to
design a webstore. I can understand how to write programs that generate
HTML
etc. But how do you get input from a client over the web to be processed
by a Lisp
program?
Answers, advice, book recommendations, etc, appreciated.
Thanks!
>
> Simple example: suppose I want a Lisp program to write out a data file
> which is used by
> another program (written in Fortran say) and I want to just write a
> shell script that runs
> the Lisp program and then the Fortran program... How can this be done?
>
An Alternative is to run the Lisp listener as a shell, write a "script" in
Lisp that generates a file and run the fortran program via an external
system call. A Lisp listener is already a shell just like bash. If you
need the return values from fortran you can parse the output in Lisp.
You can even use ILISP and run the "shell" from within emacs, complete with
read line editing and command recall.
Lisp "shell" scripts are just Lisp files which can be run by just calling
(load "lisp-script-file").
Wade
·····@asu.edu writes:
> With C or Fortran you make an executable which can be run from the
> Linux shell. How can you make a Lisp executable? What are the
> alternatives to always having to go into the lisp interactive
> environment and working there?
There is no ANSI standard way to do it, but nearly all Lisp vendors offer
something that you execute (usually from an init script) that looks like
(save-image "foo.exe" :toplevel-function 'run-my-program)
In order to put the normal Lisp environment you're used to into perspective,
think of the interactive loop as a kind of "interactive, programmable linker".
> Simple example: suppose I want a Lisp program to write out a data
> file which is used by another program (written in Fortran say) and I
> want to just write a shell script that runs the Lisp program and
> then the Fortran program... How can this be done?
Most vendors probably allow you to say
lisp -init myscript.lisp
or something like that.
I think one or two implementations allow you to do the
#!/usr/local/bin/lisp
(print 'hi)
thing. Ask your vendor.
> Also, I was reading about Paul Graham's program ViaWeb (see Paul
> Graham's website) which is basically a program run on a server which
> a client can use to design a webstore. I can understand how to write
> programs that generate HTML etc. But how do you get input from a
> client over the web to be processed by a Lisp program?
There is no across-vendor standard, but most vendors have some way to
call the system with a port number to be listened to and a function to
run when connections are found on that port.
> Answers, advice, book recommendations, etc, appreciated.
Vendor. Vendor. Vendor.
Kent M Pitman <······@world.std.com> writes:
> nearly all Lisp vendors offer something [...]
> Most vendors probably allow you to say [...]
> I think one or two implementations allow you to [...]
> Ask your vendor. [...]
> There is no across-vendor standard [...]
> Vendor. Vendor. Vendor. [...]
Would there be support for a resurrection of the comp.lang.lisp FAQ?
Christophe
--
Jesus College, Cambridge, CB5 8BL +44 1223 510 299
http://www-jcsu.jesus.cam.ac.uk/~csr21/ (defun pling-dollar
(str schar arg) (first (last +))) (make-dispatch-macro-character #\! t)
(set-dispatch-macro-character #\! #\$ #'pling-dollar)
Christophe Rhodes <·····@cam.ac.uk> writes:
> Kent M Pitman <······@world.std.com> writes:
>
> > nearly all Lisp vendors offer something [...]
>
> > Most vendors probably allow you to say [...]
>
> > I think one or two implementations allow you to [...]
>
> > Ask your vendor. [...]
>
> > There is no across-vendor standard [...]
>
> > Vendor. Vendor. Vendor. [...]
>
> Would there be support for a resurrection of the comp.lang.lisp FAQ?
I and a few others have been working to get the passwords released to us
so we can update the ALU web pages. I agree we should do more to maintain
that kind of thing. We answer the same old questions over and over a lot.
On Wed, 11 Jul 2001 11:53:17 -0700, ·····@asu.edu wrote:
>Also, I was reading about Paul Graham's program ViaWeb (see Paul
>Graham's
>website) which is basically a program run on a server which a client can
>use to
>design a webstore. I can understand how to write programs that generate
>HTML
>etc. But how do you get input from a client over the web to be processed
>by a Lisp
>program?
When user fills the HTML-form and clicks 'Submit' at the web page
entered information passed to HTTP-server, which can, by convention
named 'Common Gateway Interface (CGI)', call a server-side
application, usually named 'CGI application'. Information can also be
passed through URL after ? sign without a form.
> * In message <·················@asu.edu>
> * On the subject of "stupid questions"
> * Sent on Wed, 11 Jul 2001 11:53:17 -0700
> * Honorable ·····@asu.edu writes:
>
> With C or Fortran you make an executable which can be run from the
> Linux shell. How can you make a Lisp executable? What are the
> alternatives to always having to go into the lisp interactive
> environment and working there?
vendor-dependent.
For CLISP please see
http://clisp.cons.org/impnotes.html#quickstart
--
Sam Steingold (http://www.podval.org/~sds)
Save your burned out bulbs for me, I'm building my own dark room.
Thanks everyone.
Your advice has been very helpful.
A summary of what I've learned so far:
In the shell:
$ clisp -c myprogram.lisp
Output is myprogram.fas
Then either just
$ clisp myprogram.fas
or add "#!/usr/local/bin/clisp" to the beginning of the .fas file then
$ chmod +x myprogram.fas
and finally
$ myprogram.fas
executes the program...
Nifty.
I also discovered that you can run a program from the lisp "shell"
> (execute "program.x")
Cool.
I'm still working on the client-server interaction thing but I think I'll
manage...
Thanks!
·····@asu.edu wrote:
> I also discovered that you can run a program from the lisp "shell"
FYI: The "Lisp shell" is generally simply called "listener"
ciao,
Jochen