From: Kenny Tilton
Subject: Newbie Conversion Problem: EXEs fro free Lisps?
Date: 
Message-ID: <3F3D28BE.9000205@nyc.rr.com>
I was surprised today to discover I had converted a fellow skater far 
enough that he was willing to try Lisp for school assignments.

But the instructor insists on either a windows exe or a Linux directory 
with a make file.

I /think/ Corman will gen an exe, but I see the ide expires after 30 
days. Could he use emacs as an editor and talk to corman via ilisp or 
something (I am cluesless on those tools). I'll also see if he can swing 
the student price, he seems game for RoboCup as well.

Does Clisp gen exes? If not, what? A bash file with a command line that 
starts clisp and loads his source?

Any ideas welcome--there's a newbie hanging in the balance!


-- 

  kenny tilton
  clinisys, inc
  http://www.tilton-technology.com/
  ---------------------------------------------------------------
"Career highlights? I had two. I got an intentional walk from
Sandy Koufax and I got out of a rundown against the Mets."
                                                  -- Bob Uecker

From: Doug Tolton
Subject: Re: Newbie Conversion Problem: EXEs fro free Lisps?
Date: 
Message-ID: <b7eqjvkomh55gtegfdl22ggneufinr2nf6@4ax.com>
On Fri, 15 Aug 2003 18:35:42 GMT, Kenny Tilton <·······@nyc.rr.com>
wrote:

>I was surprised today to discover I had converted a fellow skater far 
>enough that he was willing to try Lisp for school assignments.
>
>But the instructor insists on either a windows exe or a Linux directory 
>with a make file.
>
>I /think/ Corman will gen an exe, but I see the ide expires after 30 
>days. Could he use emacs as an editor and talk to corman via ilisp or 
>something (I am cluesless on those tools). I'll also see if he can swing 
>the student price, he seems game for RoboCup as well.
>
>Does Clisp gen exes? If not, what? A bash file with a command line that 
>starts clisp and loads his source?
>
>Any ideas welcome--there's a newbie hanging in the balance!

Interestingly I was browsing the Corman Yahoo Group earlier today, and
I came across this same question:

http://groups.yahoo.com/group/cormanlisp/message/1581

That link has both the question and the answer.  The short answer is
yes you can use Emacs as the ide for Corman.  He also presents the
code to put in your .emacs file for setting it up.

Good Luck.


Doug Tolton
(format t ···@~a~a.~a" "dtolton" "ya" "hoo" "com")
From: Peter Seibel
Subject: Re: Newbie Conversion Problem: EXEs fro free Lisps?
Date: 
Message-ID: <m3smo2ptwl.fsf@javamonkey.com>
Kenny Tilton <·······@nyc.rr.com> writes:

> I was surprised today to discover I had converted a fellow skater far
> enough that he was willing to try Lisp for school assignments.
> 
> But the instructor insists on either a windows exe or a Linux
> directory with a make file.
> 
> I /think/ Corman will gen an exe, but I see the ide expires after 30
> days. Could he use emacs as an editor and talk to corman via ilisp or
> something (I am cluesless on those tools). I'll also see if he can
> swing the student price, he seems game for RoboCup as well.
> 
> Does Clisp gen exes? If not, what? A bash file with a command line
> that starts clisp and loads his source?

On Linux (don't know about Windows), you can use a #! line to turn a
CLISP program into an "executable". I.e. just the way Perl or Python
scripts work. I think you can even cat together the #! line with a
.fasl rather than a .lisp file.

-Peter

-- 
Peter Seibel                                      ·····@javamonkey.com

         Lisp is the red pill. -- John Fraser, comp.lang.lisp
From: Edi Weitz
Subject: Re: Newbie Conversion Problem: EXEs fro free Lisps?
Date: 
Message-ID: <87znia1xrb.fsf@bird.agharta.de>
On Fri, 15 Aug 2003 20:06:54 GMT, Peter Seibel <·····@javamonkey.com> wrote:

> Kenny Tilton <·······@nyc.rr.com> writes:
> 
> > I was surprised today to discover I had converted a fellow skater
> > far enough that he was willing to try Lisp for school assignments.
> > 
> > But the instructor insists on either a windows exe or a Linux
> > directory with a make file.
> > 
> > I /think/ Corman will gen an exe, but I see the ide expires after
> > 30 days. Could he use emacs as an editor and talk to corman via
> > ilisp or something (I am cluesless on those tools). I'll also see
> > if he can swing the student price, he seems game for RoboCup as
> > well.
> > 
> > Does Clisp gen exes? If not, what? A bash file with a command line
> > that starts clisp and loads his source?
> 
> On Linux (don't know about Windows), you can use a #! line to turn a
> CLISP program into an "executable". I.e. just the way Perl or Python
> scripts work. I think you can even cat together the #! line with a
> .fasl rather than a .lisp file.

You can also make CMUCL-compiled files executable:

  <http://www.cons.org/cmucl/doc/executable.html>

But no matter if you're doing this with CLISP or with CMUCL the
instructor will have to have the corresponding Lisp implementation on
his machine to run it. It looks to me as if he doesn't want that.

But, to quote Thomas F. Burdick:

  "You can certainly deliver apps with CMUCL: compile your lisp files
   (to native code), load them into a fresh image, dump a core
   containing your application, and ship cmucl, your core, and a
   little program that runs cmucl with your core and starts your app.
   If you want everything to be all compiled code everywhere, make
   that last little program written in C -- it doesn't *have* to be a
   shell script, even if that's generally easier."

  (from <···············@apocalypse.OCF.Berkeley.EDU>)

So, that would be the way to go to "deliver an executable" if the
instructor is ready to accept a couple of megabytes. Maybe you can
even fool around with something like gzexe to reduce it to one
(smaller) file.

Or wait for CMUCL 19 which as far as I understand will be able to
deliver executables directly - at least for FreeBSD and probably also
for Linux/x86.

Cheers,
Edi.
From: Fred Gilham
Subject: Re: Newbie Conversion Problem: EXEs fro free Lisps?
Date: 
Message-ID: <u7ptj6gydt.fsf@snapdragon.csl.sri.com>
Edi Weitz writes:
> Or wait for CMUCL 19 which as far as I understand will be able to
> deliver executables directly - at least for FreeBSD and probably
> also for Linux/x86.

Well, I'm the one (I think) who's doing the CMUCL executable
generation thing that you're talking about.  I got it working for
FreeBSD:

boomerang:lisp > ls -la lisp-exec
-rwxrwxr-x  1 fred  fred  11423977 Aug 10 08:19 lisp-exec
boomerang:lisp > ./lisp-exec -noinit
CMU Common Lisp 18e+ CVS Mod 09-Aug-2003, running on boomerang.csl.sri.com
With core: /alpha/homes/fred/cmucl/freebsd/lisp/lisp-exec
Dumped on: Sat, 2003-08-09 21:53:49-07:00 on boomerang.csl.sri.com
Send questions and bug reports to Freddie, 
or to ··········@cons.org. and ·········@cons.org. respectively.
Loaded subsystems:
    Python 1.1, target Intel x86
* 


My scheme works by converting a CMUCL lisp.core file into a set of ELF
object files then linking them using ld with the .o files that make up
the CMUCL lisp executable.  It's a little tricker than this but
basically that's what's involved.

The problem is that it works by custom program segments.  An ELF
executable is organized in memory according to segments.  There's
basically a text and a data segment (oversimplified but pretty much
true).  Then when the program is loaded, the kernel maintains a memory
"break" address that is the end of the process memory.  Calls to brk()
and sbrk() are used to modify or examine this break address.

In both Linux and FreeBSD, when you add program segments, the kernel
ELF loader will try to put the break past the last loadable segment.
With FreeBSD, you can fool the loader by putting your segments before
the data segment in the ELF program header array even though they come
later in memory.  The kernel ELF loader just loads your segments and
ignores them, putting the break after the data segment.  Unfortunately
Linux is too "smart" for this.  It keeps track of all the loadable
segments and puts the break after the last one.  This makes it
difficult, and perhaps impossible, to use a custom executable layout,
at least one that puts the segments later in memory than the data
segment.

I'm looking for a bright idea here.  If there is any Linux expert who
can suggest a way around this, I'd really like to hear it!

-- 
Fred Gilham                                         ······@csl.sri.com
It is also well to note that there are probably not ten hand-grenades
in the entire philosophical community.                  -- John Lange
From: Christopher C. Stacy
Subject: Re: Newbie Conversion Problem: EXEs fro free Lisps?
Date: 
Message-ID: <uptj63ax0.fsf@dtpq.com>
>>>>> On 15 Aug 2003 22:17:28 +0200, Edi Weitz ("Edi") writes:
 Edi> So, that would be the way to go to "deliver an executable" if the
 Edi> instructor is ready to accept a couple of megabytes. 

It would be unreasonable of the instructor not to accept a couple
of megabytes.  What's the big deal with that?

I installed a Logitech mouse driver on Windows 2000 the other day.
It turns out that it's a 4 MB program that runs all the time,
and it's only function is to notice when I am thumbing the wheel.
From: Paolo Amoroso
Subject: Re: Newbie Conversion Problem: EXEs fro free Lisps?
Date: 
Message-ID: <Mxc+P5G=I1uCJomQBahuvJ4AfU7i@4ax.com>
On Fri, 15 Aug 2003 18:35:42 GMT, Kenny Tilton <·······@nyc.rr.com> wrote:

> Does Clisp gen exes? If not, what? A bash file with a command line that 
> starts clisp and loads his source?

The procedure(s)--more than one on some systems--for delivering
applications with CLISP on all supported platforms, including Windows, is
explained in the implementation notes document.


Paolo
-- 
Paolo Amoroso <·······@mclink.it>
From: Thomas F. Burdick
Subject: Re: Newbie Conversion Problem: EXEs fro free Lisps?
Date: 
Message-ID: <xcv8yprebat.fsf@conquest.OCF.Berkeley.EDU>
Kenny Tilton <·······@nyc.rr.com> writes:

> I was surprised today to discover I had converted a fellow skater far 
> enough that he was willing to try Lisp for school assignments.
> 
> But the instructor insists on either a windows exe or a Linux directory 
> with a make file.

If by "windows exe", he means a single file ending in .exe, CLISP
can't do that; you can dump a custom core, but you still need a small
cluster of files, not one .exe.

It would work on Linux, evven if it would be really slow (build CLISP,
then the app).

> Does Clisp gen exes? If not, what? A bash file with a command line that 
> starts clisp and loads his source?

The latter, pretty much.  The Unix Lisps all deliver in a fashion
that's normal for Unix or the Mac: a small cluster of files.  In this
case, the VM plus a core, plus a small shell script to put it all
together.  FWIW, this is also how Netscape was delivered (more or
less).

Probably Corman is the way to go.

-- 
           /|_     .-----------------------.                        
         ,'  .\  / | No to Imperialist war |                        
     ,--'    _,'   | Wage class war!       |                        
    /       /      `-----------------------'                        
   (   -.  |                               
   |     ) |                               
  (`-.  '--.)                              
   `. )----'                               
From: pete kirkham
Subject: Re: Newbie Conversion Problem: EXEs fro free Lisps?
Date: 
Message-ID: <3f4093bf$0$956$cc9e4d1f@news.dial.pipex.com>
Thomas F. Burdick wrote:
> If by "windows exe", he means a single file ending in .exe, CLISP
> can't do that; you can dump a custom core, but you still need a small
> cluster of files, not one .exe.

You could make a self extracting zip file which contains all your files, 
extracts them and runs the lisp VM.

But before you try that, explain to your instructor that you'd like to 
use clisp, and how it packages its applications.

Usually the restriction's there so that the instructor doesn't have to 
mess about with windows executables that rely on seven DLLs being placed 
into different system directories, each of which has to be version 7.3.7 
/not/ 7.3.8 or 7.3.6.

If all your files are within the one directory, and there is no 
requirement to install DLLs, and you can assure them that the auxillary 
files won't mean they have to spend an afternoon reinstalling windows, 
the your instructor will probably let you off the one .exe requirement.


Pete