tags:

views:

986

answers:

12

I picked up a LISP book at a garage sale the other day and was just wondering if it was worth spending some time on.

+6  A: 

Depends on the book. Which book?

Common Lisp is worth learning today because it's one of the few languages that pretty much "does everything". If there's some mainstream or obscure programming idiom or technique, odds are Common Lisp has it already in some form. About the only thing CL lacks is continuations (many argue it doesn't need them, but that's not helpful if you want to explore them).

Anyone spending any serious time writing in Common Lisp will come out Changed in some way, typically for the better, IMHO.

Even if you can't carry all of the Lispy concepts you learn and use in to other environments, knowing about them and how they work is still useful.

Will Hartung
Well, CL _has_ delimited continuations. There are even web-frameworks built around them.
dmitry_vk
+9  A: 

It is worth learning for "mind-expansion" purposes but not so popular for building apps these days.

However, it is powerful, and mature, and there are fast and free compilers out there. So there is no reason not to choose it for a program if you like.

The way in which Lisp treats data structures and program structures the same offers amazing power which is worth understanding.

Its history is fascinating and it has shaped the world of computer science.

Be sure to check out Ableson and Sussman's Structure and Interpretation of Computer Programs at MIT OpenCourseware

Clojure: a Lisp on .NET and Java VMs

GNU CLISP.

CMU Common Lisp

Joe Koberg
CMUCL isn't updated as much any more. I'd stick with SBCL, unless there's a reason to use the older one.
Ken
That's not really true. SBCL is more active than CMUCL, but CMUCL is actively maintained. Just three weeks ago had with CMUCL 20a a new major release. CMUCL also has monthly snapshot releases.
Rainer Joswig
What exactly is the difference between "CMUCL isn't updated as much" and "SBCL is more active"? :-) You say, (< a b), I say (> b a)...
Ken
+3  A: 

See this question, and especially the third answer, the one that explains that Lisp is good for solving complicated problems, those problems that are hard to decompose into more manageable modules if you were to try to solve them in another language. In other words, if you are keen on exploring ways to solve convoluted problems, that involve, let's say Natural Language Processing, or Knowledge Aggregation... then, yes, Lisp might just be useful to you.

luvieere
A: 

It (Common Lisp) is still heavily used by academics working in Artificial Intelligence. Scheme is a Lisp-like language used by many (most?) CS departments as well. Personally I think learning Lisp is worthwhile whether or not you end up using it. It's a classic language that we've learned a great deal from over time.

280Z28
Can you give some examples for Common Lisp? The only people I know are the ones working with Kevin Knight at USC/Information Sciences Institute.
Nathan Sanders
Gordon Novak at UT uses Lisp in all but the two entry level classes he teaches (which the curriculum specifies Java for): http://www.cs.utexas.edu/~novak/
280Z28
+1  A: 

This is like questioning if "it's worth to learn C these days of web programming?". Only you can decide if it's worth. What you have to ask yourself is: what am I trying to achieve reading the book?

Learning new languages sometimes aren't useful in the practical sense of things (maybe you're aren't going to use LISP ever in your life), but in the long term it's going to be useful because of the knowledge acquired by different paradigms you aren't too familiar with - and you could use some of you learned in what you already use today.

GmonC
I'd emphasize the "sometimes" in your second paragraph. Learning new languages *sometimes* isn't useful in the practical sense of things, but sometimes it *is* quite useful. I find that when I learn a new language I frequently start to see potential uses for it in places I wouldn't have expected. Acquiring knowledge of different paradigms and gaining skill in using different tools (including different languages) is fundamentally a very **practical** skill for a modern software engineer.
Daniel Pryden
What I said about practical is that sometimes people want to learn other languages as "silver bullets" to a lot of problems we have in development, like "I'm going to learn this language in all projects I have and it's going to solve everything", and maybe LISP isn't going to be this way, maybe he's not ever going to write a single line in it. But what he learned while reading LISP could help him solving problems in other areas in his career... the same POV as yours. Sorry if I haven't been more clear, I'm trying to suck less every day with my english skills. :)
GmonC
A: 

Learning LISP is a good way to learn functional programming effectively, and is often used as an introductory language for undergraduate students. Many people feel that Structure and Interpretation of Computer Programs, which uses the Scheme dialect of Lisp, is a book that should be on every programmers shelf.

Paul Graham has been a big proponent of Lisp, and in his book, Hackers and Painters, he describes how he used the power of Lisp to dominate the competition in creating ViaWeb for Yahoo Stores.

Elsewhere, I've seen Lisp dialects used prominently in the aerospace industry, as scripting tools for integration frameworks like Comet, and AML. Lisp will always be tied to the early AI experiments in the 1950's.

tbischel
+13  A: 

Yes. I'll stick to Common Lisp, here, though Scheme is also a superb language that has a lot to recommend it.

In Common Lisp, you have a largish multi-paradigm language that provides some things that either don't exist widely outside the Lisp family of languages, or are limited to CL and even more obscure/niche languages.

The first feature, which you can get in one way or another from CL, Scheme and quite a few other dialects, is a real macro system.

I say "real" because the system is much more complete, flexible and reliable than, say, C preprocessor macros. It's extremely difficult to get CPP macros to do even simple things (like swapping the values of two variables, or making a foreach construct) in a reliable fashion, but these are trivial with Lisp macros. This turns out to be a very powerful tool for introducing new abstractions and dispensing with "boilerplate" code.

The second feature, which is effectively limited to Common Lisp, is CLOS, the Common Lisp Object System. Despite the name, it's not a conventional OO system like that of Java with methods being part of a class's definition. Instead, it provides polymorphism through "generic functions" which are what methods are attached to, and by default allow you to do multiple dispatch.

I vastly prefer CLOS to the more usual approach to object orientation, as it makes a number of "patterns" (like the Visitor pattern) completely unneccessary and because extension of existing generic functions is so easy; others loathe it because it takes an extremely cavalier approach to encapsulation and because extension of generic functions becomes arguably too easy. Either way, CLOS is different enough that I think it's worth learning just for the different perspective it provides.

The third feature, which is available outside of Lisp but still fantastic if you've never experienced it before is dynamic, interactive programming. CL debuggers tend to be extremely powerful tools, and CL provides for dynamic definition and redefinition of functions, classes and methods, all of which dramatically improves one's ability to explore a problem, test solutions of that problem and its subproblems, and finally put together a program that works correctly and efficiently.

Lastly, for a lot of classes of problems, Lisp is a great practical language. It provides good performance (usually not as fast as C, but dramatically faster than most "scripting languages"), safety, automatic memory management, a decent "standard library" of functions and tremendous opportnities for easy extension.

Pillsy
It's the interactive nature of programming Lisp which I enjoy most. I take advantage of this every day.
khedron
I've been reading the SICP book on-line, I believed that Scheme was just an implementation of LISP
Dave
Technically Common Lisp and Scheme are both dialects of McCarthy's LISP. Today though, "LISP" is shorthand for the former.
grettke
grettke: no, "Lisp" is the shorthand.
Svante
+2  A: 

Here's a Google Tech talk worth watching about a company currently producing large, complex softare for the airline industry in Common Lisp:

http://www.youtube.com/watch?v=xquJvmHF3S8

Other topics are mentioned in that video, including Clojure, a new variant of Lisp for the JVM (some work is now being done to develop Clojure for the CLR too, but that is not as far along), which is worth checking out for the way it addresses concurrency issues. See the Clojure site at:

http://clojure.org/

and, in particular at first, check out the link in the upper right on that page to some excellent Screencasts with overviews of the concurrency issues and Clojure features.

If you get interested in Lisp, and the book you found is not that great (I have an old one myself that didn't do much for me), Paul Graham's book On Lisp is available free at http://www.paulgraham.com/onlisp.html and is very good. The general Lisp idea is the same for Common Lisp or Scheme or Emacs Lisp or Clojure, but the specifics will be different - so keep that in mind if reading Graham's book, which focuses mostly on Common Lisp (with some mentions of Scheme specifics.) On Lisp is probably not the best beginner book, but it's worth going through it and just skimming over specifics you're not ready to follow in detail yet to see what is there, particularly with regard to macros, which On Lisp really explores.

Anon
This is awesome.
Davey
+1  A: 

It's been awhile since university, but after I took a 3rd year CS course that required learning Lisp and writing Lisp programs, writing and thinking recursively was a snap. Not that I had problems with recursion before the course, but afterwards, it was 2nd nature. I also used CLOS in the course (University of Toronto), but it was so long ago, I barely remember what I did.

Steve
The AI course at York had a logic programming course as a prerequisite, and that course was LISP and Prolog (The AI course ended up being Java and Prolog, but other semesters had been LISP). That was not soooo long ago (about 6 years).
FrustratedWithFormsDesigner
+4  A: 

Good programmers expose themselves to as many different programming paradigms as they can - not as many programming languages as they can.

The LISP family (there are several variants) is very worth while getting to know. Your objective should be getting your head wraped around functional programming and the lambda calculus - the paradigm that LISP is based on. Focus less on becomming an "ace" LISP programmer (that could take years).

If you find functional programming "flips your switch", try having a look at PROLOG too - here the paradigm is based on evaluation of Horn Clauses (predicate logic).

I may have spent the last 20 years earning a living as a COBOL programmer (OMG - they still have those!), but I think I am a better programmer because of the time spent learning what LISP, and a number of other programming languages were really all about.

Have a blast...

NealB
A: 

As other have alluded to, Lisp isn't that popular anymore for general programming, and it definitely (IMO) has some major problems for writing real systems in, but of course others disagree (for instance much of ITA's software is written in Lisp, and they make crazy bank).

Even if you never write a 'real' program in Lisp, it is absolutely worth learning. There are many programming techniques originally pioneered in Lisp that, knowing them, will help you write better code in Python, Perl, Ruby, ML, Haskell, and even C++. For instance, check out Higher Order Perl, which shows how to do all kinds of amazing tricks in Perl; to quote the introduction "Instead of telling you how wonderful Lisp is, I will tell you how wonderful Perl is, and in the end you will not have to know any Lisp, but you will know a lot more about Perl. [...] Then you can stop writing C programs in Perl. I think you will find it to be a nice change. Perl is much better at being Perl than it is at being a slow version of C."

And there are some great books out there that use Lisp, and it will be easier to understand them if you know the language - SICP, Norvig's Paradigms of Artificial Intelligence Programming, and The Reasoned Schemer all come to mind as must-reads.

Jack Lloyd
A: 

Learn lisp to learn about macros, and that code is data, and to learn that you can reach enlightenment w/o the self-flagellation of C++.

Learn Common Lisp to learn about reader macros and compiler macros. I don't know any other language that has them.

Learn scheme for continuations.

Learn Clojure because it's going to make Java obsolete :-)

Tim Schaeffer