From: Rusty Shackleford
Subject: lisp in production
Date: 
Message-ID: <slrnd2pe14.bno.rs@mwilson.umlcoop.net>
I'm learning lisp and using sbcl, emacs, and slime.  The way I run my
programs now is by starting emacs, opening a buffer with my source code,
and then I use C-c C-k to compile and execute the file.  This is great
while developing, but at some point, the program is finished, and I just
want to execute it without having to run emacs simultaneously.

I come from a C background, and I keep wanting to find some way of
running a compiled lisp program as a stand-alone executable, like
./a.out or something like that.

Is this possible?  Is it advisable?  Am I missing the point of lisp?


TIA

From: ···········@gmail.com
Subject: Re: lisp in production
Date: 
Message-ID: <1110228463.930766.85380@g14g2000cwa.googlegroups.com>
Hello,
I had the same problem, and a program called screen turned out to be a
great solution:

http://www.gnu.org/software/screen/

Hm, at least it is when I'm programming servers. You can also do
something like this:

Create a file, call it hello.lisp, and put this in it:

(write-line "Hello World!")

..then save it, and then do this (from the REPL):

(require :sb-executable)
(compile-file "hello")
(sb-executable:make-executable "hello" "hello.fasl")

..it works. It will not however produce a stand-alone executable.
From: Sam Steingold
Subject: Re: lisp in production
Date: 
Message-ID: <u1xaroutf.fsf@gnu.org>
> * Kristian Elof Sørensen <····@vzntr.qx> [2005-03-08 00:06:22 +0100]:
>
> The size of the runtime + your corefile + any other files needed is
> likely to be at least an order of magnitude larger than that of a
> Lispworks generated executable.

I think you are quite mistaken wrt CLISP.
CLISP memory images tend to be quite small (a few MB).
Did you actually try it?

-- 
Sam Steingold (http://www.podval.org/~sds) running w2k
<http://www.honestreporting.com> <http://pmw.org.il/> <http://www.iris.org.il>
<http://www.memri.org/> <http://www.camera.org> <http://www.mideasttruth.com/>
The plural of "anecdote" is not "data".
From: Frank Buss
Subject: Re: lisp in production
Date: 
Message-ID: <d0iefh$akd$1@newsreader2.netcologne.de>
Rusty Shackleford <··@natchie.mine.nu> wrote:

> Is this possible?  Is it advisable?  Am I missing the point of lisp?

it is possible, see for example http://www.frank-buss.de/lisp/aqueduct.html 
but I don't know if it is possible with SBCL.

> Is it advisable? Am I missing the point of lisp?

depends on your project. If it is an end-user program, I think it is a good 
idea to deliver a standalone program, because it is easier to install for 
the user. If it is a server program, it may be better to deliver the 
sources, because then you can easier change the running system.

-- 
Frank Bu�, ··@frank-buss.de
http://www.frank-buss.de, http://www.it4-systems.de
From: GP lisper
Subject: Re: lisp in production
Date: 
Message-ID: <1110258013.d39dee1eb9df69b7b4a2564bef37ea1d@teranews>
On Mon, 07 Mar 2005 20:23:00 GMT, <··@natchie.mine.nu> wrote:
> I'm learning lisp and using sbcl, emacs, and slime.  The way I run my
> programs now is by starting emacs, opening a buffer with my source code,
> and then I use C-c C-k to compile and execute the file.  This is great
> while developing, but at some point, the program is finished, and I just
> want to execute it without having to run emacs simultaneously.
>
> I come from a C background, and I keep wanting to find some way of
> running a compiled lisp program as a stand-alone executable, like
> ./a.out or something like that.
>
> Is this possible?  Is it advisable?  Am I missing the point of lisp?

GCL will probably compile your code to a relocatable object that can
be linked with gcc into a standalone.  GCL is not fully ANSI
compliant, so it does depend on the actual code.

However, it does depend on the circumstances for running your program
how important this need might be.  Generally the script loader
suggestions from other posters are more than adequate for most needs.
The 3 commercials will make stand-alones, should you be able to
generate the revenue to pay for them.

If you just want a simple way to run some code for yourself, just
start sbcl itself and compile, then load your program, finally start
it.  You can automate that process with startup files, or use a saved
image already containing the code of interest.

-- 
Everyman has three hearts;
one to show the world, one to show friends, and one only he knows.
From: Camm Maguire
Subject: Re: lisp in production
Date: 
Message-ID: <54is42l6d7.fsf@intech19.enhanced.com>
Greetings!

GP lisper <········@CloudDancer.com> writes:

> On Mon, 07 Mar 2005 20:23:00 GMT, <··@natchie.mine.nu> wrote:
> > I'm learning lisp and using sbcl, emacs, and slime.  The way I run my
> > programs now is by starting emacs, opening a buffer with my source code,
> > and then I use C-c C-k to compile and execute the file.  This is great
> > while developing, but at some point, the program is finished, and I just
> > want to execute it without having to run emacs simultaneously.
> >
> > I come from a C background, and I keep wanting to find some way of
> > running a compiled lisp program as a stand-alone executable, like
> > ./a.out or something like that.
> >
> > Is this possible?  Is it advisable?  Am I missing the point of lisp?
> 
> GCL will probably compile your code to a relocatable object that can
> be linked with gcc into a standalone.  GCL is not fully ANSI
> compliant, so it does depend on the actual code.
> 

There are two strategies in GCL:

1) (si::save-system "foo") -- this makes a complete lisp system
   executable with whatever compiled code you've loaded in, which may
   be invoked as any other executable would.  It is portable in the
   sense that the executable may be moved to machines on which GCl is
   not available.  The binary is large therefore, and is roughly
   equivalent to a statically linked binary.

2) gcl -batch foo.o, where foo.o was output via (compile-file
   "foo.lisp") or some such.  Executables are smaller, but GCL is
   required on the system.  Here GCL roughly fills the role of ld.so.  

Take care, 


-- 
Camm Maguire			     			····@enhanced.com
==========================================================================
"The earth is but one country, and mankind its citizens."  --  Baha'u'llah
From: Julian Stecklina
Subject: Re: lisp in production
Date: 
Message-ID: <pan.2005.03.08.13.07.04.909456@web.de>
On Mon, 07 Mar 2005 20:57:53 -0800, GP lisper wrote:

> On Mon, 07 Mar 2005 20:23:00 GMT, <··@natchie.mine.nu> wrote:
>> I'm learning lisp and using sbcl, emacs, and slime.  The way I run my
>> programs now is by starting emacs, opening a buffer with my source code,
>> and then I use C-c C-k to compile and execute the file.  This is great
>> while developing, but at some point, the program is finished, and I just
>> want to execute it without having to run emacs simultaneously.
>>
>> I come from a C background, and I keep wanting to find some way of
>> running a compiled lisp program as a stand-alone executable, like
>> ./a.out or something like that.
>>
>> Is this possible?  Is it advisable?  Am I missing the point of lisp?
> 
> GCL will probably compile your code to a relocatable object that can
> be linked with gcc into a standalone.  GCL is not fully ANSI
> compliant, so it does depend on the actual code.

ECL (Embeddable Common Lisp) will do the same and generates very small
executables (some tens of kilobytes for small apps plus libecl.so which is
about 1.3 MB on my system). ECL's web presence looks a bit abandoned, but
the mailing list is alive. -> ecls.sf.net

Regards,
-- 
Julian Stecklina

-- Common Lisp can do what C, C++, Java, PASCAL, PHP, Perl, (you --
-- name it) can do. Here's how:                                  --
--                                                               --
-- http://www.amazon.com/exec/obidos/ASIN/1590592395             --
From: Mario S. Mommer
Subject: Re: lisp in production
Date: 
Message-ID: <fzr7iqb5s3.fsf@germany.igpm.rwth-aachen.de>
Julian Stecklina <··········@web.de> writes:
> ECL (Embeddable Common Lisp) will do the same and generates very small
> executables (some tens of kilobytes for small apps plus libecl.so which is
> about 1.3 MB on my system).

Wow.
From: Julian Stecklina
Subject: Re: lisp in production
Date: 
Message-ID: <pan.2005.03.09.05.56.10.821696@web.de>
On Tue, 08 Mar 2005 14:56:12 +0100, Mario S. Mommer wrote:

> 
> Julian Stecklina <··········@web.de> writes:
>> ECL (Embeddable Common Lisp) will do the same and generates very small
>> executables (some tens of kilobytes for small apps plus libecl.so which is
>> about 1.3 MB on my system).
> 
> Wow.

See you on
·········@lists.sourceforge.net
;)

Regards,
-- 
Julian Stecklina

-- Common Lisp can do what C, C++, Java, PASCAL, PHP, Perl, (you --
-- name it) can do. Here's how:                                  --
--                                                               --
-- http://www.amazon.com/exec/obidos/ASIN/1590592395             --
From: ···········@gmail.com
Subject: Re: lisp in production
Date: 
Message-ID: <1110394386.838055.14050@f14g2000cwb.googlegroups.com>
Julian Stecklina wrote:
> On Tue, 08 Mar 2005 14:56:12 +0100, Mario S. Mommer wrote:
>
> >
> > Julian Stecklina <··········@web.de> writes:
> >> ECL (Embeddable Common Lisp) will do the same and generates very
small
> >> executables (some tens of kilobytes for small apps plus libecl.so
which is
> >> about 1.3 MB on my system).
> >
> > Wow.
>
> See you on
> ·········@lists.sourceforge.net
> ;)
>
> Regards,
> --
> Julian Stecklina
>
> -- Common Lisp can do what C, C++, Java, PASCAL, PHP, Perl, (you --
> -- name it) can do. Here's how:                                  --
> --                                                               --
> -- http://www.amazon.com/exec/obidos/ASIN/1590592395             --
From: Paolo Amoroso
Subject: Re: lisp in production
Date: 
Message-ID: <87ll8z199q.fsf@plato.moon.paoloamoroso.it>
Rusty Shackleford <··@natchie.mine.nu> writes:

> I'm learning lisp and using sbcl, emacs, and slime.  The way I run my
> programs now is by starting emacs, opening a buffer with my source code,
> and then I use C-c C-k to compile and execute the file.  This is great

You may want to check SLIME:

  SLIME: The Superior Lisp Interaction Mode for Emacs
  http://common-lisp.net/project/slime/


> I come from a C background, and I keep wanting to find some way of
> running a compiled lisp program as a stand-alone executable, like
> ./a.out or something like that.
>
> Is this possible?  Is it advisable?  Am I missing the point of lisp?

It is possible, but the delivered application will probably not look
the way you expect.  This is system dependent.  With CMUCL, you
deliver:

- the CMUCL executable, `lisp'
- a saved Lisp image (see EXT:SAVE-LISP) containing your application
- a script for starting the CMUCL executable and providing it your
  image as an argument, something like this:

  #!/bin/sh

  YOUR_APP_DIR=`dirname $0`
  exec $YOUR_APP_DIR/lisp -core $YOUR_APP_DIR/your-app.core -quiet

SBCL, if I recall correctly, has a contrib module for automating this.


Paolo
-- 
Why Lisp? http://lisp.tech.coop/RtL%20Highlight%20Film
Recommended Common Lisp libraries/tools (see also http://clrfi.alu.org):
- ASDF/ASDF-INSTALL: system building/installation
- CL-PPCRE: regular expressions
- UFFI: Foreign Function Interface
From: Marco Baringer
Subject: Re: lisp in production
Date: 
Message-ID: <m2vf83f2lp.fsf@soma.local>
Kristian Elof S�rensen <····@image.dk> writes:

> Sadly sbcl, cmucl and clisp cannot do anything like this. Withe them
> you have to either write install scripts that automatically puts your
> core files, the lisp runtime etc. in the correct places on whatever
> setup the user might have, or rely on the usr to be willing and
> capable of messing with this themself. The size of the runtime + your
> corefile + any other files needed is likely to be at least an order of
> magnitude larger than that of a Lispworks generated executable.

you're absolutly right and i don't want to debate that. however i do
want to provide some data points. i'm currently working with two apps,
one is deployed on MacOS X and the other on windows. 

the sizes of the distributions:

- the macosx app, which contains the openmcl runtime and image file,
  is 7 MB (the image file contains, ucw (and asociated libs),
  cl-ppcre, plus the app code itself).

- the windows app contains (on the CD i give to the client) a
  standalone clisp executable (and the reuqired cygwin libs) and a
  clisp image file (which contains ucw, araneida and the app
  itself). the total size is about 11 MB (plus the DB).

the installation:

both of the apps are installed by copying from the CD to any random
directory (generally C:\Programmi and /Applications/) and clicking on
the startup icon (on windows it's a .bat ond osx it's a .command (ugly
but functional)).

my point:

you are perfectly right in saying that only allegro and lispworks can
generate relativly small 'stand alone' executables, i'd like to point
out that nobody really cares.

p.s. - I generally distribute all the source code and version control
files and both of these apps are backed by databases; the effective
total size of the distributions run about 30 MB (i don't know what
exactly you included in your 5MB number). 30MB may be prohibitivly
large for downloading over the internet, but since i'm competing with
.net and java apps my distributions are about half the size of what
people expect (and memory consumption is about a fifth of similar
apps).

-- 
-Marco
Ring the bells that still can ring.
Forget the perfect offering.
There is a crack in everything.
That's how the light gets in.
	-Leonard Cohen
From: Frank Buss
Subject: Re: lisp in production
Date: 
Message-ID: <d0j7lc$lj8$1@newsreader2.netcologne.de>
Kristian Elof S�rensen <····@image.dk> wrote:

> Of the two I have only tried Lispworks myself. A small GUI program ends 
> up as an executable in the 5 MB size range.

you can tweak it a bit, for example you can exclude bignum or complex 
number support, if you don't need it. My Aqueduct game is a 4,259,868 bytes 
exe file on Windows and 1,523,552 bytes zip-packed.

-- 
Frank Bu�, ··@frank-buss.de
http://www.frank-buss.de, http://www.it4-systems.de
From: Alexander Repenning
Subject: Re: lisp in production
Date: 
Message-ID: <1110303196.221238.316600@f14g2000cwb.googlegroups.com>
Rusty Shackleford wrote:

> I come from a C background, and I keep wanting to find some way of
> running a compiled lisp program as a stand-alone executable, like
> ./a.out or something like that.
>
> Is this possible?  Is it advisable?  Am I missing the point of lisp?

Possible and advisable (for a commercial product).

MCL (OS X) allows you to create regular double clickable apps that look
no different from any other appliaction written in C, C++. The
developer environment is purged out but for some apps the compiler,
with special license, can be left in. Two examples:

Deep Navel, a web navigation creation tool (http://deepnav.com/). For
the most part users do not see Lisp. Pick a theme press a button.
Powerusers, in contrast, can provide some Lisp snippets to render their
own Web pages. This is a big leap that only few users are willing to
take. So, for the most part Deep Navel users not only never use Lisp,
in most cases they will not even know Lisp is inside.

AgentSheets (http://agentsheets.com/) is a simulation authoring tool.
The authoring part is based on a visual programming language called
Visual AgenTalk. This is a drag and drop type interface to program the
behavior of agents. Each drag and drop thingy, called a command, turns
into a Lisp expression, which, in turn, gets compiled by the MCL Lisp
compiler. The same Lisp expression can also be turned into a Java
program using our Java bytecode compiler. We could have called the
whole thing Visual Lisp but at the time this did not seem to be a good
marketing move ;-) To create a Windows version we had to switch to Java
because at the time everybody (not including me) wanted to program in
Java. It took us 10 additional programmers create AgentSheets for
Windows. The agent behavior compiler was trivial to write in Lisp but
was a beast in Java.

To move from an early Lisp hack to a complete app can take quite a bit
of time. Users have high expectations: they want to see a regular
installer/uninstaller, GUI adhering to platform specific guidlines (and
not to some Lisp tool), error handling that does not end up in the Lisp
debugger, no listener or Emac windows, double clickable app and
documents, no s-expression-based "interface" etc. etc.

Alex

Prof. Dr. Alexander Repenning
vCard: http://www.cs.colorado.edu/~ralex/AlexanderRepenning.vcf
From: ivant
Subject: Re: lisp in production
Date: 
Message-ID: <1110370987.602226.123080@o13g2000cwo.googlegroups.com>
Rusty,

Check out this [1] article by Nikodemus Siivola, where he explains
exactly this using SBCL.

HTH,
Ivan

[1] http://www.niksula.cs.hut.fi/%7Etsiivola/log/3309245899.html

P.S. If anybody know how to quote (parts of) the article I'm replying
to in Google groups, please speak up :)
From: ·········@jippii.fi
Subject: Re: lisp in production
Date: 
Message-ID: <1110377568.446100.314290@g14g2000cwa.googlegroups.com>
> P.S. If anybody know how to quote (parts of) the article I'm replying
> to in Google groups, please speak up :)

If you did mean like this, I'd recommend trying "new" google groups,
they're at the beta stage like everything else ;)

http://groups-beta.google.com/

It has cleaner look, posted messages arrive faster, more features, etc.

- Sampo
From: ivant
Subject: Re: lisp in production
Date: 
Message-ID: <1110383056.747915.228150@l41g2000cwc.googlegroups.com>
>> P.S. If anybody know how to quote (parts of) the article I'm
replying
>> to in Google groups, please speak up :)
>
>If you did mean like this, I'd recommend trying "new" google groups,
>they're at the beta stage like everything else ;)
>
>http://groups-beta.google.com/
>
>It has cleaner look, posted messages arrive faster, more features,
etc.

That's exactly what I mean, and I'm using the new groups, but I
couldn't find this anywhere.  I've done it manually for this article.
From: David Magda
Subject: Re: lisp in production
Date: 
Message-ID: <86ll8wolpd.fsf@number6.magda.ca>
"ivant" <········@gmail.com> writes:

> That's exactly what I mean, and I'm using the new groups, but I
> couldn't find this anywhere.  I've done it manually for this
> article.

The original Groups.Google interface is still available at:

    http://groups.google.ca/

Who knows for how long.

-- 
David Magda <dmagda at ee.ryerson.ca>, http://www.magda.ca/
Because the innovator has for enemies all those who have done well under
the old conditions, and lukewarm defenders in those who may do well 
under the new. -- Niccolo Machiavelli, _The Prince_, Chapter VI
From: Pascal Bourguignon
Subject: Re: lisp in production
Date: 
Message-ID: <87hdjkpyck.fsf@thalassa.informatimago.com>
David Magda <··················@ee.ryerson.ca> writes:

> "ivant" <········@gmail.com> writes:
> 
> > That's exactly what I mean, and I'm using the new groups, but I
> > couldn't find this anywhere.  I've done it manually for this
> > article.
> 
> The original Groups.Google interface is still available at:
> 
>     http://groups.google.ca/
> 
> Who knows for how long.

Then why do you use it?   I can't imagine using an application that
someone else can revoke anytime.  How stressfull it must be.  Already
with proprietary applications, you're at the mercy of the vendor not
correcting the bugs you stumble upon, but at least, the program runs
on your computer and you can be assured to be able to use it next day.
But with web applications?!!!


And it's not like there's a scarcity of good news readers...

-- 
__Pascal Bourguignon__                     http://www.informatimago.com/
You never feed me.
Perhaps I'll sleep on your face.
That will sure show you.
From: Hannah Schroeter
Subject: Re: lisp in production
Date: 
Message-ID: <d0n30g$b1s$2@c3po.use.schlund.de>
Hello!

 <·········@jippii.fi> wrote:
>> P.S. If anybody know how to quote (parts of) the article I'm replying
>> to in Google groups, please speak up :)

>If you did mean like this, I'd recommend trying "new" google groups,
>they're at the beta stage like everything else ;)

>http://groups-beta.google.com/

>It has cleaner look, posted messages arrive faster, more features, etc.

But it mutilates articles and has a less obvious thread display.

>- Sampo

Kind regards,

Hannah.
From: ivant
Subject: Re: lisp in production
Date: 
Message-ID: <1110384357.200265.314600@o13g2000cwo.googlegroups.com>
Hannah Schroeter wrote:
> Hello!
>
>  <·········@jippii.fi> wrote:
> >> P.S. If anybody know how to quote (parts of) the article I'm
replying
> >> to in Google groups, please speak up :)
>
> >If you did mean like this, I'd recommend trying "new" google groups,
> >they're at the beta stage like everything else ;)
>
> >http://groups-beta.google.com/
>
> >It has cleaner look, posted messages arrive faster, more features,
etc.
>
> But it mutilates articles and has a less obvious thread display.

You can click on the "view as tree" link and see the old, two-frame
interface.

>
> >- Sampo
>
> Kind regards,
>
> Hannah.

BTW, I found out how to quote.  It was buried under "show
options/reply".  Not to be mistaken with the other reply.  And in Lisp
I just use '

--
Ivan
From: Alexander Schreiber
Subject: Re: lisp in production
Date: 
Message-ID: <slrnd2v1iu.vi8.als@mordor.angband.thangorodrim.de>
·········@jippii.fi <·········@jippii.fi> wrote:
>> P.S. If anybody know how to quote (parts of) the article I'm replying
>> to in Google groups, please speak up :)
> 
> If you did mean like this, I'd recommend trying "new" google groups,
> they're at the beta stage like everything else ;)
> 
> http://groups-beta.google.com/
> 
> It has cleaner look, posted messages arrive faster, more features, etc.

And it destroys email addresses, thereby losing an important feature of
the old archive. Justifying this with "spam protection" is total and
utter bullshit. 

Regards,
       Alex.
-- 
"Opportunity is missed by most people because it is dressed in overalls and
 looks like work."                                      -- Thomas A. Edison