Why Common Lisp Bothers Me
lovehateubuntu.blogspot.com
lovehateubuntu.blogspot.com
- executables: [1] - library: while there are certain libraries that are harder to set up in CL than Ruby/Python, the provided example of list and string functions is laughable. [2] [3]
[1] http://www.xach.com/lisp/buildapp/ [2] http://cl-cookbook.sourceforge.net/strings.html#number
Agreed that thinking Common Lisp lacks adequate ways to manipulate sequency things is quite funny. The main problem is the lack of definitive libraries for things that were not included in the standard 20 some years ago.
However, exposing the innards of a program on event of an error can be undesirable. CL's behavior of dropping you into the debugger is great when you're writing software that doesn't have to be delivered, or that is entirely open-source, but you can't do closed-source executables that way.
(handler-case (main-user-function)
(error (c)
(princ "a serious error, I'm quitting")
(quit))
(condition (c)
(princ "we have a problem")
(when (y-or-n-p "abort?")
(abort))))
It handles conditions of class ERROR in the first clause and conditions of class condition (all kinds of stuff that one can signal) in the second clause. The variable 'c' would be the condition object. You could inspect it and print more useful help, show dialogs, look for restarts and more.You are free to handle all errors in your application and never drop into a debugger. Common Lisp comes with a 'condition system' that let's you handle errors, recover from errors, show users possible restarts and more.
1.4.3 Sections Not Formally Part Of This Standard
'Within the concept sections, subsections whose names begin with the words
``Note'' or ``Notes'' or ``Example'' or ``Examples'' are provided for
illustration purposes only, and are not considered part of the standard.'A Google search for java runtime results in top hits like "Download Free Java Software", "Java Downloads for All Operating Systems", "Java SE Downloads" (with the pertinent phrase visible, "What Java Do I Need?").
A search for Lisp runtime results in top hits like a chapter from the gigamonkeys.com Lisp book, an irrelevant question thread on StackOverflow, and a somewhat relevant page about the Lisp runtime that comes with Autodesk.
I can imagine that doing something like, say, making an easy-to-find, easy-to-download, easy-to-install package of CLisp, tossing in wx widget bindings for good measure, would go a long way toward making distribution of Lisp software easier.
Save the Lisp image to a single executable. Done.
It's not as trivial as that.
Besides - that's not the real problem here. It's always "possible" to do something. But if a random developer gets to write some software and still doesn't know that he can package it into a single executable... maybe there's something wrong on a different level (accessible documentation?)
What kind of installer do you need for a single executable file?
But that's not something one should reasonably expect from a Lisp REPL or compiler; that's just packaging, and there are installers out there that excel at that. I suppose it would be expected that modern Lisp IDEs have support for that.
On the Mac I would use LispWorks to create the usual application directory that can be dragged into the systems' application folder - the usual and easiest way to install applications on the Mac.
LispWorks has a delivery guide that explains how to deliver applications on Unix, Windows, Linux, FreeBSD and Mac OS X.
http://www.lispworks.com/documentation/lw60/DV/html/delivery...
Buildapp, mentioned elsewhere in this discussion, looks like a good solution. But, as with most things Common Lisp, it is tied to a specific distribution (in this case, SBCL).
In what platform?
Yep... As I recall from responses to this critique, 99.9% of C programs cannot run without support from libraries either, usually already installed with the OS. Even though the executable size looks small, you still end up loading up a large code image into memory as you statically include all those dependent user mode libraries.
I have not tried it myself, but I remember reading something that suggested you could install part of the Lisp image on your system and have a slimmed down executable that knows how to autoload the main image (there was some kind of bootstrapping technique in there).
In a sense, this is an advantage with a Lisp binary as compiled by SBCL in that almost everything you need is bundled into the one image (easy to deploy!)...with the caveat, of course, that you will still need whatever external libraries the binary requires.
Note that I have little experience with other Lisp systems -- and not enough experience, really, with SBCL to be more than a novice on this subject. Like others, though, I was looking for the "how to make an executable" answer, and what I found satisfied me. I can mix Lisp binaries with other stuff I use at work.
Don't get me wrong, I still love me some common lisp --- but I agree with Britton that the issue shouldn't be dismissed as meaningless.
Java also deploys an image that needs to be executed in a runtime, but the industry is so familiar with the JVM that it is a moot point.
Delivers an executable as a single file in LispWorks. Most implementations have something similar depending on what kind of architecture they are based on). Exceptions are Lisp to C compilers and Lisp Machines. But it is unlikely that you will use one of them.
I seem to remember sbcl having some way to compile real executables though, someone back me up on this?