?

Log in

No account? Create an account

Lisp executables

I'm glad Jasko made it easy for Cusp users to make executables, but I found his characterization of newbie interactions pretty insulting. I like to help people with Lisp stuff, and the conversation usually goes like this:

  • Q: "Does Lisp have a compiler?"
  • A: "Yes, you can use COMPILE or COMPILE-FILE..."
  • Q: "Awesome!" time passes "Wait, what I really want is something else..."
  • A: "Ok, you can do that with save-lisp-and-die, or cl-launch, and commercial Lisps make it pretty easy too..."
  • Q: "Cool, I'll check it out" or "If there isn't something exactly like gcc for Lisp, Lisp sucks!"
  • A: "Glad to help!" or "You can still get stuff done even without a single-file executable" or "Whatever, dude."
Tags:

Comments

(Anonymous)

exacly like gcc

Oh, but there *is* something exactly like gcc for Lisp - ECL. And it's getting better day by day.
In fairness, I think there is often an element of deliberate misunderstanding...
I can't help it if I know what "compile" actually means!

(Anonymous)

I rather like the elitism in the CL community -- but it does go a bit far at times. To find a dig at that 'insulting' seems a little thin-skinned. (Which brings me to another defining property of that same community. ;)
-- Marijn, who still hasn't got an OpenID
It would be less insulting if it referenced a less contrived scenario.

(Anonymous)

I think the point is...

If you know the conversation usually starts like this:
  • Q: "Does Lisp have a compiler?"
  • A: "Yes, you can use COMPILE or COMPILE-FILE..."
  • Q: "Awesome!" time passes "Wait, what I really want is something else..."

then why don't you mention save-lisp-and-die up front? :)

(Anonymous)

Re: I think the point is...

Exactly. I attended a few lisp user group meetings a few years ago. At the time I was fairly experienced with Scheme, but not with Lisp (and unaware of Lispers' reputation for being smarter-than-thou). I stopped going after realizing that most of the members were stuck on showing how inferior any other language is, and not too interested in helping others reach their level of understanding.

Re: I think the point is...

Is that the same group Jasko went to?

(Anonymous)

A newbie is probably coming from a world where compiling means generating an executable file from source code.

So a question like "Does Lisp have a compiler?" probably means "Is there a 'free' Lisp on Windows that will generate an executable file that can run without a dependency on the whole Lisp environment being installed."

(Anonymous)

I agree, and I agree that mentioning SAVE-LISP-AND-DIE early is helpful. I think the problem is that mentioning SAVE-LISP-AND-DIE without making clear that CL and C(++) simply don't work the same way is also bound to create many more misunderstandings down the road: Personally, I remember far more cases where newbies were put off by SAVE-LISP-AND-DIE than newbies who found that it really was what they expected; while it did create an executable, a common test case was to create a hello world (or otherwise functionally trivial program) program and then create an executable. Depending on the implementation you're using, you're very likely going to get a huge executable compared to compiling a similar C/C++ program, precisely because you /do/ need to include the whole runtime environment.

The initial reaction frequently is a (very understandable) case of disappointment: if your hello world takes 12MB to deliver, how large would anything more useful be? While this doesn't scale like that for real programs, you won't get that across if you don't point out that creating stand-alone Lisp executables isn't the most common way to run (even less to develop) Lisp programs in most implementations. So it's not a matter of providing easy answers or being a jerk; it's a trade-off between providing easy answers with misleading implications which often (but certainly not always) lead to confusion/disappointment later on or providing a more accurate answer which doesn't reinforce misguided assumptions (but still answers the question). Granted, there may be many people who use the latter option as an excuse to be a jerk at the same time, but that's an entirely different point ;-)
I think a helpful starter is to point out that Lisp development cycles are indeed different than C/C++ development cycles, just as they differ in Perl, Ruby, Python, Java, Javascript, etc. Yes, it's good to know that you can deliver a standalone executable when you need it, but it's misleading to advertise that as the recommended/best way. I'm not saying that Cusp does that, and I'm sure it'll be very useful for people who use Cusp; I just think that this point is something one should keep in mind. I've seen the same "why can't I just create an executable" question arise frequently in other contexts (e.g. Perl or Java), and it's rarely as much of a problem as new users initially make it out to be.

(Anonymous)

executables n stuff

I don't get two things: why does it matter and, if it matters, why can't lisps do a better job of it?

Okay, I get lisp has a big runtime support library. So how big is the C runtime library? Why is creating a stand alone executable such a low priority of the system implementors? Why isn't it easy with a little glue code to turn the output of compile-file into an stand alone executable? Then distribute the big runtime library plus your tiny executable? C programs would have to do the same thing except they can (usually) assume that OS distributions already have the c runtime installed.

So if distributing a big runtime library is painful and users just want a tiny executable why can't lisps cull unused portions of their runtimes? Isn't that simply a slightly different application of garbage collection? As long as your code isn't calling eval somewhere it seems like you should be able to determine at link time what isn't used.

Re: executables n stuff

I don't think it matters much to many of the people able to implement it in open source Lisps. There is in general a lack of manpower for improving Lisp implementations, and specifically few people devote their time to changing the implementation to match outside expectations. It doesn't happen automatically; people like Jasko have to perceive a need and meet it by doing the work.

Not everyone agrees on the needs and the priorities for fixing them. One way to get someone else to agree with the need and priority is to apply money. There are cheaper ways, but usually they involve charm and persuasion...