From: Hemanth P.S.
Subject: Newbie Question: How to build an executable out of lisp source files
Date: 
Message-ID: <9be5e130.0405030204.33790fd8@posting.google.com>
I have recently got interested in Lisp and I remember reading
somewhere that you
can generate native executables from lisp sources (if all functions
are annotated) and run them which will be much faster than running
through the interpreter.

I have downloaded both CLISP and GCL but I am not able to figure out a
way from their documentation nor from any FAQ how to generate an exe
on Windows. Can someone point me to the right direction.

Thanks.
--Hemanth

From: Camm Maguire
Subject: Re: Newbie Question: How to build an executable out of lisp source files
Date: 
Message-ID: <54ad0p8uyn.fsf@intech19.enhanced.com>
Greetings!  For GCL:

(compile-file "foo.lisp")
(load "foo.o")
(si::save-system "new_image")

will result in a standalone executable which can run without further
reference to GCL, i.e. without GCL itself being installed.
Alternatively, one could treat foo.o as the executable and run it in
compiled mode via 'gcl -batch foo.o', which of course does require the
presence of GCL on the system.

Take care,

················@yahoo.com (Hemanth P.S.) writes:

> I have recently got interested in Lisp and I remember reading
> somewhere that you
> can generate native executables from lisp sources (if all functions
> are annotated) and run them which will be much faster than running
> through the interpreter.
> 
> I have downloaded both CLISP and GCL but I am not able to figure out a
> way from their documentation nor from any FAQ how to generate an exe
> on Windows. Can someone point me to the right direction.
> 
> Thanks.
> --Hemanth

-- 
Camm Maguire			     			····@enhanced.com
==========================================================================
"The earth is but one country, and mankind its citizens."  --  Baha'u'llah
From: Matthew Danish
Subject: Re: Newbie Question: How to build an executable out of lisp source files
Date: 
Message-ID: <20040503155655.GE25328@mapcar.org>
On Mon, May 03, 2004 at 03:04:42AM -0700, Hemanth P.S. wrote:
> I have recently got interested in Lisp and I remember reading
> somewhere that you can generate native executables from lisp sources
> (if all functions are annotated) and run them which will be much
> faster than running through the interpreter.

You don't have to do this separately, most implementations support the
notion of compiling and loading code into the running image.  Also,
annotations aren't required, but can help.  But don't put them in until
you test your code (don't optimize prematurely).

> I have downloaded both CLISP and GCL but I am not able to figure out a
> way from their documentation nor from any FAQ how to generate an exe
> on Windows. Can someone point me to the right direction.

Camm has pointed out how to do this with GCL.  But as you are first
learning, you probably won't need to do this.  It is a mistake to do it
during the development process.  You can have fully-compiled code
without having to dump an executable image.  Generally, either using
(load (compile-file "file.lisp")) or by defining the function and typing
(compile 'function-name), you can ensure that the compiler is run on the
code you write.  The functions will be available, from the top-level,
but will have been compiled.  So it is not strictly an interpreter that
you interact with.

A proper Lisp IDE will provide keybindings for compiling and loading
files and definitions.  I suggest either obtaining the LispWorks
Personal Edition which gives you the LispWorks compiler and IDE for free
personal use [1], or you can try out (shameless plug =) my "Lisp in a
Box" which is Emacs, CLISP, and SLIME pre-packaged for Windows [2].

[1] http://www.lispworks.com/
[2] http://www.mapcar.org/~mrd/lispbox/

-- 
; Matthew Danish <·······@andrew.cmu.edu>
; OpenPGP public key: C24B6010 on keyring.debian.org
; Signed or encrypted mail welcome.
; "There is no dark side of the moon really; matter of fact, it's all dark."
From: Ryan J. Bovorasmy
Subject: Re: Newbie Question: How to build an executable out of lisp source files
Date: 
Message-ID: <pan.2004.05.03.23.00.44.770447@sdf-eu.org>
> A proper Lisp IDE will provide keybindings for compiling and loading
> files and definitions.  I suggest either obtaining the LispWorks
> Personal Edition which gives you the LispWorks compiler and IDE for free
> personal use [1], or you can try out (shameless plug =) my "Lisp in a
> Box" which is Emacs, CLISP, and SLIME pre-packaged for Windows [2].
> 
> [1] http://www.lispworks.com/
> [2] http://www.mapcar.org/~mrd/lispbox/

Use the shameless plug, trust me. I don't use windows, but Emacs,
SLIME, and CLISP are a superb combo, and you're lucky to have found
someone who's prepackaged it for you.
From: Hemanth P.S.
Subject: Re: Newbie Question: How to build an executable out of lisp source files
Date: 
Message-ID: <9be5e130.0405040124.7dce7c4f@posting.google.com>
Thank you all for providing me these tips. I downloaded Lisp In a Box
and have just tried it for 5 minutes. It's really great. I think I
will use this environment to learn Lisp.

Meanwhile I also tried using compile-file, load, and si::save-system
on GCL on
a simple hello.lsp file containing just the format function. The
interpreter exits on trying to produce an exe. It does however
generate an exe; but trying to run it gives a "DLL oncrpc.dll not
found" error.

--Hemanth
From: Mario S. Mommer
Subject: Re: Newbie Question: How to build an executable out of lisp source files
Date: 
Message-ID: <fzzn8o7cwj.fsf@germany.igpm.rwth-aachen.de>
················@yahoo.com (Hemanth P.S.) writes:
> Meanwhile I also tried using compile-file, load, and si::save-system
> on GCL on a simple hello.lsp file containing just the format
> function. The interpreter exits on trying to produce an exe.

Ob nitpick: It is not an interpreter. It is an environment which
includes a full compiler.

Just so you know :)
From: mikel
Subject: Re: Newbie Question: How to build an executable out of lisp source files
Date: 
Message-ID: <R%6mc.45234$SZ5.29605@newssvr29.news.prodigy.com>
Hemanth P.S. wrote:

> I have recently got interested in Lisp and I remember reading
> somewhere that you
> can generate native executables from lisp sources (if all functions
> are annotated) and run them which will be much faster than running
> through the interpreter.
> 
> I have downloaded both CLISP and GCL but I am not able to figure out a
> way from their documentation nor from any FAQ how to generate an exe
> on Windows. Can someone point me to the right direction.

Your question confuses a couple of different issues. Most Common Lisp 
compilers (but not all) can generate native executable code, but that's 
not the same thing as generating an .exe file. Most compilers can 
compile source files to object files full of native executable code, and 
load that executable code into the running Lisp environment. (CLISP is 
an exception; it compiles to bytecode).

Some Common Lisp compilers can also make .exe files; Corman Lisp is one 
that can do so on Windows; Lispworks is another. These are commercial 
products, but you can use the compilers for free for personal use.

Corman can also generate DLLs, by the way.