Acknowledgments
First of all, Id like to thank my wife Lauren for letting me spend so many weekends on this book project. I am also particularly grateful to Philip Fominykh, the main technical reviewer for this book, whose extensive experience with proper Common Lisp form and style helped to reign in many (but not too many) quirks in the source code and in the discussions of Lisp philosophy. I also owe a great deal to Heow Eide-Goodman, who reviewed the final chapters and helped complete this project.
Many folks at No Starch Press had to wrestle with the idiosyncratic prose and structure of this book to bring it into publishable form. First and foremost, I want to thank Keith Fancher, my primary editor for most of this project. Great effort was also put in by Bill Pollock, Serena Yang, Ansel Staton, Riley Hoffman, Alison Petersen, Magnolia Molcan, Kathleen Mish, Don Marti, Tyler Ortman, and Adam Wright. Id also like to thank Aaron Feng for early feedback on the style of the book.
This book project originally began as an expansion of my Casting SPELs in Lisp web tutorial. I want to thank everyone who emailed or talked with me about this tutorial and helped me expand my understanding of Lisp along the way. rms (Richard Stallman), in particular, gave me a lot of feedback on Lisp style and helped me put together the Emacs Lisp version of the tutorial. Please consider donating to the Free Software Foundation (http://www.fsf.org/), a nonprofit organization he founded to support the development of open source and free software, which includes many great Lisp tools. James Webb also helped greatly with the Emacs Lisp version. And among the countless folks who gave feedback and/or corrections on Casting SPELs in Lisp, Id especially like to thank Kenny Tilton, Marshall Quander, Wei-Ju Wu, Christopher Brown, Stephen Gravrock, Paul Schulz, Andy Cowell, and Johan Bockgrd.
Introduction
So, youve decided to pick up a book on Lisp and read the introduction. Perhaps you were surprised to see something that looks like a comic book mixed in with the other computer programming books on the shelf. Who would bother writing a comic book about a weird academic programming language like Lisp? Or maybe youve heard other people raving about the Lisp language and thought, Boy, Lisp sure sounds different from other languages people talk about. Maybe I should pick up a Lisp book sometime. Either way, youre now holding a book about a programming language that is very cool but also very unusual.
What Makes Lisp So Cool and Unusual?
Lisp is a very expressive language. Lisp is designed to let you take the most complicated programming ideas and express them in a clear and appropriate way. Lispers have the freedom to write a program in exactly the way that is most helpful for solving any problem at hand.
The power at your fingertips when writing Lisp code is what makes it so different. Once you get Lisp, youll be forever changed as a programmer. Even if you end up never writing Lisp code again for the rest of your life, learning Lisp will fundamentally change you as a coder.
In a way, learning a typical programming language is similar to learning a foreign language as an adult. Suppose you go out tomorrow and decide youre going to learn French. You may take every course on French that you can find, read materials that are only in French, and even move to France. But no matter what you do, your understanding of French will always remain a little imperfect. And no matter how good of a French speaker you eventually become, in your dreams you probably will still be speaking in your native language.
Lisp is different. Its not just like learning any foreign language. Once youve learned Lisp, youll even dream in Lisp. Lisp is such a powerful idea that it will crowd out your previous programming experience and become your new mother tongue! Whenever you encounter a new programming idea in any language, youll always say to yourself, Thats kind of how Id do it in Lisp, except.... Thats the kind of power only Lisp will give you.
At this point, all you may know about Lisp is that at least one person (me) is extremely excited about it. But your time is valuable, and learning something new is bound to require some effort.
The good news is Lisp isnt really as difficult as it may seem at first glance. For instance, the following is a valid Lisp expression:
(+ 3 (* 2 4))
Can you guess what the value of this expression is? If you answered 11, then youve already figured out how to read basic Lisp code. It is written just like math, except that the functionsin this case, addition and multiplicationcome before the numbers, and everything is in parentheses.
If Lisp Is So Great, Why Don't More People Use It?
Actually, a fair number of large companies do use Lisp for some serious work (youll find a long list of industrial Lisp projects at http://snipurl.com/e3lv9/). Other programming languages are constantly borrowing features of Lisp and presenting them as the latest and greatest ideas. Also, the Semantic Web, which many believe will play a big role in the future of the Web, uses many tools written in Lisp.
Note
The idea behind the Semantic Web is to create a set of protocols for websites to follow so that a computer can determine the meaning of information on a web page. This is done by annotating web pages with special metadata (usually in a format called Resource Description Framework, or RDF) that links to common vocabularies, which different websites may share. Many of the tools used for working with description logics and RDF data are written in Lisp (for example, RacerPro and AllegroGraph).
So, Lisp certainly has a promising future. But some may think that learning Lisp is not worth the effort.
How did Lisp get this undeserved reputation?
I think that people use a rule of thumb when deciding what things in life are worth learning. Most people seek knowledge in one of the following three categories:
- What many other people learn (calculus, C++, and so on)