Re: compiling a Lisp source to exe



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/
.



Relevant Pages

  • Re: How to install GD for bugzilla
    ... Your test script isn't needed at this point, ... you still need to install the perl module for GD. ... it is a script that passes configuration data to the compiler. ...
    (perl.beginners)
  • How to ppm GD? (was RE: How to install GD for bugzilla)
    ... When you use ppm, ... How to install GD for bugzilla ... Your test script isn't needed at this point, ... it is a script that passes configuration data to the compiler. ...
    (perl.beginners)
  • Re: Newbie. How do I install video drivers with Linux?
    ... The tar is like an unzip. ... among those will be a script to do the install. ... The install may require that you have the compiler and kernel headers to compile the driver. ...
    (linux.redhat)
  • Re: 2 Versions of XLC at once ?
    ... "Dale Pennington" wrote in message ... > script that will allow you to install in the non-default directory, ... > Since we do not want to lose the current compiler that works to check that ...
    (comp.unix.aix)
  • problems about gcc installation
    ... i need to install gcc, and when i install it, the following problems ... configure: loading cache ./config.cache ... checking for C compiler default output file name... ... checking whether the linker supports shared libraries... ...
    (comp.unix.programmer)