Tuesday, April 18, 2006

Lisp: Paul Graham? Too many Lisps?

I didn't mean to create a blog.

I read a critique of Lisp in another blog, and felt moved to respond. But the space for the comments seemed so cramped. It seemed like a bright idea to create my own blog and defend my favorite programming language at length. (As if I don't have a million better things to do.)

The critique was by Steve Yegge. He said several things, but let me mention two: that Lisp's recent increase in popularity is due to Paul Graham; and that there are too many Lisps to choose from.

The first seems absurd to me, but I don't know how to evaluate it. I thought Lisp was making a modest (very modest) comeback because Java had made garbage collection respectable; or because of the not unrelated fact that computers have gotten so fast that some of Lisp's inefficiencies (and Java's, and Python's) can be overlooked. Enough intro-CS courses expose students to Scheme that the idea of Lisp keeps rippling through impressionable young minds.
John McCarthy once said that Lisp seems to be a lucky discovery of a local maximum in the space of programming languages. Plenty of people are happy finding the top of that particular hill. Others have slightly different objective functions.

I've never met Paul Graham or heard him speak. I gather he's exciting to listen to. If he's helped keep fuel in Lisp's tank, that's great. But I think comp.lang.lisp has been a greater source of inspiration for people coming into the Lisp community, as have ALU, Cliki, and other such.

Another point Mr. Yegge made was that there are too many Lisps to choose from, making life difficult for the beginner (as compared to the beginning Python programmer). I've noticed that there are too many GNU/Linux versions out there. Sometimes that's just the way it is.

However, in the case of Lisp there's a deeper point to be made. It's in the nature of Lisp that it grows in many directions simultaneously outside of central control. I have myself posted a macro package called YTools
that transforms Lisp into a streamlined power demon or into an unreadable mess. (People differ on this issue.) I have another called Nisp that adds strong static typing to Lisp. I find I can't get along without these tools. Other people have other tools that they make available, some of which have caught on with a wider community although most have not.

The situation is not different with other programming languages, except that in the case of Lisp tool packages make syntactic extensions to the core language. If this whole idea gives you the willies, stay away from Lisp. If it sounds intriguing, you might still want to stay away, because Lisp can be addictive. I never program in any other language if I can help it. (My job involves teaching intro programming, which requires me to write simple Java programs, which I find fun. I've occasionally had to write some C or C++ code to run on a robot. I once had to hack Latex2HTML to fix some bugs, which convinced me that programming in Perl was something I should try to avoid if possible.)

There is a portability problem with Lisp, although in my experience it's not quite what one might expect. 90% of the bugs I find when porting from one CL to another are cases where the original implementation was too forgiving of departures from the language standard. A program that's worked fine for years can be ported to a different implementation where you find out it's buggy. I don't know what to say about this except that (a) I've learned that keeping a suite of tests around for any piece of software is a good idea; and (b) YTools and Nisp at this point have been ported and tested on Allegro, CMU Lisp, CLISP, and Open Macintosh CL. Getting them cleaned up was an exercise in anality, but they certainly are superstable as a result of the exercise.


Michael H. said...
This comment has been removed by a blog administrator.
Michael H. said...

I suspect my last comment should have been attached to this post, not the next one. Sigh. Anyway...

Paul Graham has played a small role in making Lisp more visible and more popular, in the last few years. The sale of Viaweb to Yahoo!, to become the Yahoo! stores, was simultaneously a success story and a failure for Lisp all at once. It was a success because a handful of smart people were able to write something incredibly flexible, bug-free, and useful in a short span of time, providing feedback to users and responses to feature requests without taking down the site -- very lispy, and unheard of for most standard websites. It was a high visiblity, high money dot-com success story where Lisp was the secret weapon.

It was also a failure, in some respects, because Yahoo! decided that it had to rewrite it in C++. Whether this was because they didn't think they could hire enough Lisp programmers, or because they this was just standard bureaucracy, is unclear. And the new site was, at least at the time, slower, less featureful, less interesting.

I got to meet Paul Graham at ILC 2003. He seems nice, sharp, funny -- a fine spokesman, if we had to choose one. I'd also credit him with popularizing Bayesian-style spam filtering; while it would have come about eventually, his "A Plan for Spam" paper kicked off the burst of activity which makes my email inbox readable today.

It's hardly just Paul Graham, though, that has to do with the "Lisp Resurgence". Partly it's the fact that the pendulum is swinging back towards server-side programming, and it's easier to hide lisp there where no one knows about it. And partly it's the rise of the blogosphere, where folks like my friend at lemonodor.com have been blogging lispily for several years now, and it's a different sort of conversation than you get on comp.lang.lisp.

These days, I use an RSS reader (NetNewsWire), and have 11 different lisp-related blogs I read on at least a weekly basis. The sense of community is very nice -- there's still a pulse there, and it feels like it's only getting stronger.

Vijay Lakshminarayanan said...

Could you please elaborate on why case-insensitivity in Common Lisp is a mis-feature? With such a large set of variable names possible, I was under the impression that case was truly irrelevant to the language (and the worst case of |CamelCase and lowercase and WHITESPACE| are still possible).

I am not an expert in CL but do love the language very much.

airfoyle said...

I'm afraid I don't get your argument. "With such a large set of variable names possible" — a larger set than for other languages? Why is Lisp the only language whose identifiers are not case-sensitive?

When Lisp was created, programs were still being input on punched cards, so all symbols were upper case. As the language evolved, a series of decisions were made to preserve backwards compatibility, and while each decision may have made sense, they got us to a point no one would choose if designing the language from scratch.

For some concrete ways in which case-insensitivity causes problems, look at
the discussion of modern mode

in the Allegro Lisp documentation. But aesthetics alone should be sufficient to reject it.

nakadaldalus said...

Most languages that have only one canonical implementation are in this situation because:

- they are very young (Python, Ruby, etc.)
- they are difficult to implement and have no published standards (Perl)
- they aren't very popular (Erlang)

Most successful languages older than about 1990 have many different implementations.

Languages with many implementations include: Lisp, Scheme, C, Fortran, C++, Pascal, ML, BASIC, Smalltalk, the Bourne shell, SQL, Javascript, Java. (And Java would be more diverse now had Sun not essentially sued Microsoft's variant out of existence.)

Multiple implementations are a sign of success.

Visual Basic, one of the most popular languages of all time, is also case-insensitive. I've never heard anyone complain about it. Case sensitive identifiers really add nothing to the language except for a new potential source of bugs.

Anonymous said...

The information here is great. I will invite my friends here.


Anonymous said...

Do you have copy writer for so good articles? If so please give me contacts, because this really rocks! :)