Re: compiling a Lisp source to exe
- From: philip.armitage@xxxxxxxxx
- Date: Tue, 30 Sep 2008 09:48:52 -0700 (PDT)
On 30 Sep, 13:14, cartercc <carte...@xxxxxxxxx> wrote:
I would like to achieve some competency in Lisp but Lisps do not
typically get installed on machines and do not have a 'LRE' (or do
they?) Therefore, the only easy way I can think of to run a script
written in Lisp is to compile and distribute it as an exe.
Below are the options I've used for different project depending on how
much control I had over the target machine (mostly repeating what
people have already said):
1. Just distribute the code and install a Lisp compiler on the machine
you want to run on. You may want to supply a shell script or batch
file to start everything up correctly so that the end user doesn't
have to use the REPL. I find CLISP particularly good for this (you can
even use it in a 'shebang script').
2. Distribute your code and a Lisp compiler in a tarball with a shell
script. This can be convenient if you want to include additional
libraries as you can roll up ASDF and a 'systems' directory, etc. You
may also need to use a nice init file for your compiler which sets up
ASDF for loading systems from relative pathnames if you use external
libraries.
3. As 2 but compile an image file with all the code that you need.
Details for the exact syntax required to do the saving and the exact
command line to do the loading are implementation specific. The image
file is often quite large unless the compiler implements a tree shaker
of some kind.
4. Many compilers provide the ability to create an image file and wrap
it up as an "executable". The executable will likely be of a similar
size to the image in 3 (slightly larger). The syntax to do this, if
available, is usually an extension of 3.
I'm guessing what you'd really like is 4 but there is merit to the
other approaches that people have described, particularly if you
intend to run multiple programs on the destination machine and install
a Lisp once (like you would with Python or Ruby on a server).
Of course, if you intend to distribute the compiler, make sure you're
allowed to under its license.
--
Phil
http://phil.nullable.eu/
.
- References:
- compiling a Lisp source to exe
- From: cartercc
- Re: compiling a Lisp source to exe
- From: Rainer Joswig
- Re: compiling a Lisp source to exe
- From: cartercc
- Re: compiling a Lisp source to exe
- From: Rainer Joswig
- Re: compiling a Lisp source to exe
- From: cartercc
- compiling a Lisp source to exe
- Prev by Date: Re: compiling a Lisp source to exe
- Next by Date: Re: Lisp Design Patterns
- Previous by thread: Re: compiling a Lisp source to exe
- Next by thread: Re: compiling a Lisp source to exe
- Index(es):
Relevant Pages
|