Domain: paulgraham.com
Stories and comments across the archive that link to paulgraham.com.
Comments · 1,105
-
Re:I can't stand articles like thisIt could have been done in Perl, in the worst (and fairly common) case by creating another instance of Greenspun's Tenth Law.
That's literally what would have been required if someone used Perl 4, which was what Perl was when we started in 1995. The Viaweb editor depended very heavily on lexical closures, which at that time only Lisp and Smalltalk had.
And yet, you know, I kind of think you'd be saying the same thing if Perl was Perl 4.
For more details of why we needed Lisp see these excerpts from a talk I gave recently.
--pg
-
more details
A couple people have mentioned that I didn't explain in sufficient detail what we did with Lisp. Sorry about that; I had been planning (and still plan) to write a second, more technical, article. In the meantime, there are more technical details in these excerpts from a talk I gave recently at BBN. -- pg
-
Graham on Lisp is like Schwartz on Perl...Graham's comments about the power and ease of Lisp are similar to Schwartz's comments on Perl (and perhaps Tim Peters's on Python). Each is an extreme expert in the language, and each can perform tasks well beyond most people's capabilities. His opinions are based on that level of expertise, and his observations may not apply to people with less experience.
The fact that he took notice of Perl- and Python-using competitors is significant. He views those languages as being nearly as powerful as Lisp; their main deficiency is that their syntax isn't ``easily extensible.'' Both possess means of extending syntax, but the revealed expressive power is handicapped by the languages' definitions.
Lisp macros work directly on Lisp objects, which exist after parsing but before compilation. Perl mostly lacks that middle ground (or rather it has 12004782 different middle grounds, depending on how you look at it), and Python's AST system is terribly difficult to use (and somewhat non-portable). Both of those languages treat syntax extensions as black magic; Lisp makes them everyday tools.
Lisp does have its problems. The package system is slightly obtuse, and the inheritance scheme in standard CLOS is completely busted. And it's only as portable as its implementations. The free Common Lisp implementations that run on many platforms are interpreters. The compilers run on a very restricted number of platforms. And there's no equivalent to CPAN. But it's still worth a look.
-
thoughts on Paul Graham and Common Lisp
I'm a big fan of Common Lisp as well as Paul Graham (having read his book ANSI Common Lisp, I can see that he possesses both in-depth technical knowledge and a sense of humor). This article seems to match what I've read of him in quality, and I look forward to reading it in more depth when I get home.
I'm not a Lisp guru by any means, but the one thing that I always get a kick out of is how easy it is to become a low-level guru. After a few weeks of playing, I was doing things I wouldn't have dreamed of doing in C or Java. And it changes one's perspective. It all translates to machine code at the lowest level, of course, but after learning Lisp I can say without a doubt that I'm a better C programmer.
Lisp is an interesting language, because in some ways it's ridiculously high level (closures, generic functions, garbage collection, et cetera), but you're also able to get down and dirty with the cons cells with no trouble. I think this quote expresses it best:
What I like about Lisp is that you can feel the bits between your toes.
Lisp is extremely versatile. While it was originally used in AI, it's honestly the best tool for most situations I come across. (You can see one thing I've done here, and I've done some other stuff that I haven't had a chance to post yet.) Whenever I need to do more in the shell than loop through a few files, I write it in Lisp (I've written 5-line programs to leech an entire Web page's MP3 archive). Lisp is great at processing logs, the output of various subprocesses, and other such things. It's also got a wonderful OO system.-- Drew McDermott
Graham's "Blub" example holds true for everyone I've met who has a disdain for Lisp. The advanced features it provides really do go over their heads, which is sad, because these are often intelligent people. Also, they don't look beyond the syntax differences, and often have a lot of misinformation (Lisp is slow, you can't do iteration in Lisp, Lisp is for lists and AI) fed to them by CS professors or whoever. I also often see a lot of posts from newbies who want to write "C-Lisp" and give up when that doesn't work. Lisp is a different paradigm, and needs to be treated as such.
If you're interested in Lisp, I would recommend reading The Evolution of Lisp (don't be angry at the poor fonts in the PDF; they didn't use scalable TeX fonts, the weenies
:), Paul Graham's ANSI Common Lisp, and Winston and Horn's LISP, 3rd Edition (but ignore them when they disparage car and cdr), in that order.Also, don't be confused by the various Lisps out there. First, ignore Emacs Lisp. Among its quirkyisms, it's dynamically scoped, which means that if you declare a variable, every function you call will also have access to that variable. Secondly, Scheme and Common Lisp are vastly different. Scheme is much leaner, and has 1 namespace, which means you can't name a variable and a function the same thing (I dislike this, but it's a hotly contested issue). Common Lisp has a huge set of standard APIs and much more versatility prebuilt into its core, while Scheme tries to stay small so as to provide an easily implementable standard. I'm a Common Lisp man, myself, but try things out for yourself.
One final thing is that if you hang out with them, you'll realize that most of the long-time posters are extremely knowledgable and have a great sense of heritage. I've learned a great deal by simply lurking through their flamewars, since I find out a lot about what issues may crop up for an individual programmer.
If you want a bit more advocacy, see my recent posts on the subject.
--
-
A link to an interesting Lisp success story
Recently I came across the following story, which tells of Paul Graham's use of Lisp in his company, creating web-based store program, which was to become Yahoo stores.
Needless to say, Graham attributes to Lisp itself a large part of the credit in being able to accomplish what he did.