[Openmcl-devel] Re: Openmcl-devel digest, Vol 1 #139 - 7 msgs

Taoufik Dachraoui taoufik.dachraoui at wanadoo.fr
Fri Apr 18 08:21:44 PDT 2003


Hi,

I understood that openmcl applications are like java applications, in 
the sense that to run a java app we need a JVM, to run an openmcl 
application we need openmcl installed, the difference is the JVM is 
allover the places, not openmcl. For this reason I am looking for a way 
to create an executable where all needed stuff is in it (excluding 
functions in standard unix libraries and system calls), so that my lisp 
applications can run on any unix system (I hope)!

Thank you for your comments.

Taoufik

On vendredi, avr 18, 2003, at 13:28 Africa/Tunis, 
openmcl-devel-request at clozure.com wrote:

> Send Openmcl-devel mailing list submissions to
> 	openmcl-devel at clozure.com
>
> To subscribe or unsubscribe via the World Wide Web, visit
> 	http://clozure.com/cgi-bin/mailman/listinfo/openmcl-devel
> or, via email, send a message with subject or body 'help' to
> 	openmcl-devel-request at clozure.com
>
> You can reach the person managing the list at
> 	openmcl-devel-admin at clozure.com
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Openmcl-devel digest..."
>
>
> Today's Topics:
>
>    1. create an executable from openmcl (Taoufik Dachraoui)
>    2. Re: create an executable from openmcl (Gary Byers)
>    3. Re: create an executable from openmcl (Taoufik Dachraoui)
>    4. Re: create an executable from openmcl (Erann Gat)
>    5. Re: create an executable from openmcl (Erann Gat)
>    6. Re: create an executable from openmcl 
> (=?ISO-8859-2?Q?Oliver_Markovi=E6?=)
>    7. Re: create an executable from openmcl (Gary Byers)
>
> --__--__--
>
> Message: 1
> Date: Thu, 17 Apr 2003 15:19:22 +0100
> From: Taoufik Dachraoui <taoufik.dachraoui at wanadoo.fr>
> To: openmcl-devel at clozure.com
> Subject: [Openmcl-devel] create an executable from openmcl
>
> Hi,
>
> Can I create an executable program file from openmcl?
>
> example:
>
> (defun add3 (x) (+ x 3))
> (loop do (format t "~A~%" (add3 (read)))) ;;  entry point
>
> I would like to create an executable program (smallest) with the
> expression above as the entry point of the program.
>
> Kind regards
> Taoufik
>
>
>
> --__--__--
>
> Message: 2
> Date: Thu, 17 Apr 2003 09:27:44 -0600 (MDT)
> From: Gary Byers <gb at clozure.com>
> To: Taoufik Dachraoui <taoufik.dachraoui at wanadoo.fr>
> cc:  <openmcl-devel at clozure.com>
> Subject: Re: [Openmcl-devel] create an executable from openmcl
>
>
>
> On Thu, 17 Apr 2003, Taoufik Dachraoui wrote:
>
>> Hi,
>>
>> Can I create an executable program file from openmcl?
>>
>> example:
>>
>> (defun add3 (x) (+ x 3))
>> (loop do (format t "~A~%" (add3 (read)))) ;;  entry point
>>
>> I would like to create an executable program (smallest) with the
>> expression above as the entry point of the program.
>>
>> Kind regards
>> Taoufik
>>
>
> --------- begin actual unretouched screen capture --------
> [src/ccl] gb at miles> openmcl
> Welcome to OpenMCL Version (Alpha: Linux) 0.14-030415!
> ? (defun add3 (x) (+ x 3))
> ADD3
> ? (save-application "adder.image"
>                     :toplevel-function
>                     #'(lambda () (loop do (format t "~A~%" (add3 
> (read)))))
> )
> NIL
> ? [src/ccl] gb at miles> openmcl adder.image
> 4
> 7
> 5
> 8
> --------- end actual unretouched screen capture --------
>
> It'd be tempting to say that it's that easy, but that wouldn't be
> entirely accurate: we've left out some interesting details (what
> happens if there's a runtime error ? how should ^C be handled ? how do
> we get out of this loop gracefully ?)  SAVE-APPLICATION can pretty
> clearly handle the demands of ADD3, but as things start to get a
> little more complicated (what if we wanted to write "ADD-N", where N
> was passed via a command-line option ?)  I'm not confident that things
> are modularized well.
>
> This happened to have been in 0.14; 0.13 would probably behave exactly
> the same way on the example, but there are likely different ways in
> which things aren't modularized well.
>
> As far as making a "minimal" adder.image ... it's strange to hear
> myself say this, but I think that the modularity and infrastructure
> and other issues (packaging, distribution) are way more important.
> There are certainly arguments that suggest that a 5MB ADD3 program is
> somewhat excessive, but if it's a -really good- ADD3 program most
> people wouldn't care that it happens to have a (mostly unused) CL
> implementation in it.  Would they ?
>
>
>
>
> --__--__--
>
> Message: 3
> Date: Thu, 17 Apr 2003 18:05:17 +0100
> Subject: Re: [Openmcl-devel] create an executable from openmcl
> Cc: <openmcl-devel at clozure.com>
> To: Gary Byers <gb at clozure.com>
> From: Taoufik Dachraoui <taoufik.dachraoui at wanadoo.fr>
>
> Hi,
>
> I would like to create a standalone executable program. I do not want
> to use openmcl to run the program!!
>
> Let's say I write a lisp program, then I would like to create a
> standalone running program without using openmcl.
>
> Is there a way to do this? (like when we write a C program than we
> compile it and link it to create an executable)
>
> besides that adder.image runs only through openmcl, 'save-application
> created a large image. I would like an image that contains only what is
> used by my program (add, read, format) and not the whole lisp.
>
> Kind regards
> Taoufik
>
> On jeudi, avr 17, 2003, at 16:27 Africa/Tunis, Gary Byers wrote:
>
>>
>>
>> On Thu, 17 Apr 2003, Taoufik Dachraoui wrote:
>>
>>> Hi,
>>>
>>> Can I create an executable program file from openmcl?
>>>
>>> example:
>>>
>>> (defun add3 (x) (+ x 3))
>>> (loop do (format t "~A~%" (add3 (read)))) ;;  entry point
>>>
>>> I would like to create an executable program (smallest) with the
>>> expression above as the entry point of the program.
>>>
>>> Kind regards
>>> Taoufik
>>>
>>
>> --------- begin actual unretouched screen capture --------
>> [src/ccl] gb at miles> openmcl
>> Welcome to OpenMCL Version (Alpha: Linux) 0.14-030415!
>> ? (defun add3 (x) (+ x 3))
>> ADD3
>> ? (save-application "adder.image"
>>                     :toplevel-function
>>                     #'(lambda () (loop do (format t "~A~%" (add3
>> (read)))))
>> )
>> NIL
>> ? [src/ccl] gb at miles> openmcl adder.image
>> 4
>> 7
>> 5
>> 8
>> --------- end actual unretouched screen capture --------
>>
>> It'd be tempting to say that it's that easy, but that wouldn't be
>> entirely accurate: we've left out some interesting details (what
>> happens if there's a runtime error ? how should ^C be handled ? how do
>> we get out of this loop gracefully ?)  SAVE-APPLICATION can pretty
>> clearly handle the demands of ADD3, but as things start to get a
>> little more complicated (what if we wanted to write "ADD-N", where N
>> was passed via a command-line option ?)  I'm not confident that things
>> are modularized well.
>>
>> This happened to have been in 0.14; 0.13 would probably behave exactly
>> the same way on the example, but there are likely different ways in
>> which things aren't modularized well.
>>
>> As far as making a "minimal" adder.image ... it's strange to hear
>> myself say this, but I think that the modularity and infrastructure
>> and other issues (packaging, distribution) are way more important.
>> There are certainly arguments that suggest that a 5MB ADD3 program is
>> somewhat excessive, but if it's a -really good- ADD3 program most
>> people wouldn't care that it happens to have a (mostly unused) CL
>> implementation in it.  Would they ?
>>
>>
>
>
>
> --__--__--
>
> Message: 4
> Date: Thu, 17 Apr 2003 10:59:21 -0700 (PDT)
> From: Erann Gat <gat at flownet.com>
> To: openmcl-devel at clozure.com
> Subject: Re: [Openmcl-devel] create an executable from openmcl
>
>
>
> On Thu, 17 Apr 2003, Gary Byers wrote:
>
>> As far as making a "minimal" adder.image ... it's strange to hear
>> myself say this, but I think that the modularity and infrastructure
>> and other issues (packaging, distribution) are way more important.
>> There are certainly arguments that suggest that a 5MB ADD3 program is
>> somewhat excessive, but if it's a -really good- ADD3 program most
>> people wouldn't care that it happens to have a (mostly unused) CL
>> implementation in it.  Would they ?
>
> I don't know how viable a suggestion this is, but CLisp has a cute hack
> where you can chmod +x a .fasl file and will automagicaly do the right
> thing.  I think the way it's done is that .fasl files have #!/bin/clisp
> prepended to them, and then the CLisp executable has startup code that
> does the Right Thing when passed a .fasl file as a startup argument.
>
> Seems like something like this shouldn't be too hard to do.
>
> E.
>
>
>
> --__--__--
>
> Message: 5
> Date: Thu, 17 Apr 2003 11:04:50 -0700 (PDT)
> From: Erann Gat <gat at flownet.com>
> To: openmcl-devel at clozure.com
> Subject: Re: [Openmcl-devel] create an executable from openmcl
>
>
> On Thu, 17 Apr 2003, Taoufik Dachraoui wrote:
>
>> Hi,
>>
>> I would like to create a standalone executable program. I do not want
>> to use openmcl to run the program!!
>>
>> Let's say I write a lisp program, then I would like to create a
>> standalone running program without using openmcl.
>>
>> Is there a way to do this? (like when we write a C program than we
>> compile it and link it to create an executable)
>
> No.
>
> The fact of the matter is that there is no way to do it with a C 
> program
> either.  That it appears that you can is actually an illusion created 
> by
> the fact that a large number of supporting libraries are ubiquitous and
> well hidden.  Even a statically linked "executable" requires such
> libraries -- they are called the "operating system."
>
> To run a Lisp "executable" you need additional libraries that are not
> ubiquitous and not well hidden (yet).  That is what makes it appear 
> that
> Lisp is different from C in this regard.  But it isn't.  The Lisp
> libraries have to go somewhere.  You can hide them, just as the C
> libraries are hidden, and give Lisp the appearance of running 
> "standalone
> executables" in exactly the same way that C programs give this 
> appearance.
> But that's the best you can do.
>
> E.
>
>
>
> --__--__--
>
> Message: 6
> Date: Thu, 17 Apr 2003 20:06:51 +0200
> Subject: Re: [Openmcl-devel] create an executable from openmcl
> From: =?ISO-8859-2?Q?Oliver_Markovi=E6?= <lists at entrox.org>
> To: openmcl-devel at clozure.com
>
> On Donnerstag, Apr 17, 2003, at 20:04 Europe/Berlin, Erann Gat wrote:
>
>> To run a Lisp "executable" you need additional libraries that are not
>> ubiquitous and not well hidden (yet).  That is what makes it appear
>> that
>> Lisp is different from C in this regard.  But it isn't.  The Lisp
>> libraries have to go somewhere.  You can hide them, just as the C
>> libraries are hidden, and give Lisp the appearance of running
>> "standalone
>> executables" in exactly the same way that C programs give this
>> appearance.
>> But that's the best you can do.
>
> This is no different than Java - if there's no JRE installed, you can't
> run Java
> programs. People seem to have accepted that, so I wonder why there are
> people
> complaining about the same fact when using Lisp. Perhaps one should 
> make
> a package called "Lisp Runtime Environment - LRE" and take advantage of
> Sun's marketing ;-)
>
> In other news, I'm trying to decouple the Cocoa bindings from the
> example IDE
> and automate the generation of application bundles. This should make it
> easy
> to generate double-clickable applications on OS X, which could prove to
> be
> quite handy (especially to people like the original poster).
>
> --
>    Oliver Markovic
>
>
>
> --__--__--
>
> Message: 7
> Date: Thu, 17 Apr 2003 12:26:33 -0600 (MDT)
> From: Gary Byers <gb at clozure.com>
> To: Erann Gat <gat at flownet.com>
> cc:  <openmcl-devel at clozure.com>
> Subject: Re: [Openmcl-devel] create an executable from openmcl
>
>
>
> On Thu, 17 Apr 2003, Erann Gat wrote:
>
>>
>>
>> On Thu, 17 Apr 2003, Gary Byers wrote:
>>
>>> As far as making a "minimal" adder.image ... it's strange to hear
>>> myself say this, but I think that the modularity and infrastructure
>>> and other issues (packaging, distribution) are way more important.
>>> There are certainly arguments that suggest that a 5MB ADD3 program is
>>> somewhat excessive, but if it's a -really good- ADD3 program most
>>> people wouldn't care that it happens to have a (mostly unused) CL
>>> implementation in it.  Would they ?
>>
>> I don't know how viable a suggestion this is, but CLisp has a cute 
>> hack
>> where you can chmod +x a .fasl file and will automagicaly do the right
>> thing.  I think the way it's done is that .fasl files have 
>> #!/bin/clisp
>> prepended to them, and then the CLisp executable has startup code that
>> does the Right Thing when passed a .fasl file as a startup argument.
>>
>> Seems like something like this shouldn't be too hard to do.
>>
>> E.
>>
>
> On a slightly-related note: the 'header' which describes the layout
> of an OpenMCL memory image is actually a 'trailer': it's at the end
> of the file.  As long as one is careful to observe certain alignment
> constraints (or uses tools that observe them for you), you can prepend
> pretty much anything to the front of a heap image (such as a shell
> script that calls the kernel with its own pathname as an image file
> argument or, in theory at least, the kernel itself.)
>
> Somewhere or other I have some code that does this and some examples
> of how it can be used; I'll try to find it and post it somewhere.
>
>
>
>
>
> --__--__--
>
> _______________________________________________
> Openmcl-devel mailing list
> Openmcl-devel at clozure.com
> http://clozure.com/cgi-bin/mailman/listinfo/openmcl-devel
>
>
> End of Openmcl-devel Digest
>


_______________________________________________
Openmcl-devel mailing list
Openmcl-devel at clozure.com
http://clozure.com/cgi-bin/mailman/listinfo/openmcl-devel



More information about the Openmcl-devel mailing list