views:

3375

answers:

30

I really feel that I should learn Lisp and there are plenty of good resources out there to help me do it.

I'm not put off by the complicated syntax, but where in "traditional commercial programming" would I find places it would make sense to use it instead of a procedural language.

Is there a commercial killer-app out there that's been written in Lisp ?

+21  A: 

complicated syntax??

The syntax for lisp is incredibly simple.

Killer app written in lisp: emacs. Lisp will allow you to extend emacs at will to do almost anything you can think of that an editor might do.

But, you should only learn lisp if you want to, and you may never get to use at work ever, but it is still awesome.

Also, I want to add: even if you find places where lisp will make sense, you will probably not convince anyone else that it should be used over java, c++, c#, python, ruby, etc.

Justin Standard
or rather -- the core syntax of common lisp is simple. defmacro allows extending the syntax, and some of the built in macros (such as defmacro) can get incredibly complicated; lambda lists, nested backquotes, etc.
Aaron
+9  A: 

I can't answer from first-hand experience but you should read what Paul Graham wrote on Lisp. As for the "killer-app" part, read Beating the averages.

Christian Lescuyer
+3  A: 

I agree that Lisp is one of those languages that you may never use in a commercial setting. But even if you don't get to, learning it will definitely expand your understanding of programming as a whole. For example, I learned Prolog in college and while I never used it after, I gave me a greater understanding of many programming concepts and (at times) a greater appreciation for the languages I do use.

But if you are going to learn it...by all means, read On Lisp

Adam Haile
Small note: On Lisp is not a suitable introduction to Lisp, read something else first. I recommend Practical Common Lisp.
Luís Oliveira
+3  A: 

Since I don't want to ask another question and clog up the site, what are the normal/main uses for Lisp?

Teifion
Solving a hard, underspecified problem. http://bc.tech.coop/blog/060118.htmlhttp://blogs.msdn.com/patrick_dussud/archive/2006/11/21/how-it-all-started-aka-the-birth-of-the-clr.aspxAfter the prototype stage, Lisp tends to get replaced by a 'normal' language.
Nathan Sanders
+2  A: 

Complicated syntax? The beauty of lisp is that it has a ridiculously simple syntax. It's just a list, where each element of the list can be either another list or an elementary data type.

It's worth learning because of the way it enhances your coding ability to think about and use functions as just another data type. This will improve upon the way you code in an imperative and/or object-oriented language because it will allow you to be more mentally flexible with how your code is structured.

Antonio Haley
+2  A: 

Okay, I might be weird but I really don't like Paul Graham's essays that much & on Lisp is a really rough going book if you don't have some grasp of Common Lisp already. Instead, I'd say go for Siebel's Practical Common Lisp. As for "killer-apps", Common Lisp seems to find its place in niche shops, like ITA, so while there isn't an app synonymous with CL the way Rails is for Ruby there are places in industry that use it if you do a little digging.

C Hogg
+20  A: 

@Teifion

One of the main uses for Lisp is in Artificial Intelligence. A friend of mine at college took a graduate AI course and for his main project he wrote a "Lights Out" solver in Lisp. Multiple versions of his program utilized slightly different AI routines and testing on 40 or so computers yielded some pretty neat results (I wish it was online somewhere for me to link to, but I don't think it is).

Two semesters ago I used Scheme (a language based on Lisp) to write an interactive program that simulated Abbott and Costello's "Who's on First" routine. Input from the user was matched against some pretty complicated data structures (resembling maps in other languages, but much more flexible) to choose what an appropriate response would be. I also wrote a routine to solve a 3x3 slide puzzle (an algorithm which could easily be extended to larger slide puzzles).

In summary, learning Lisp (or Scheme) may not yield many practical applications beyond AI but it is an extremely valuable learning experience, as many others have stated. Programming in a functional language like Lisp will also help you think recursively (if you've had trouble with recursion in other languages, this could be a great help).

Justin Bennett
Your link to Lights out is not working, it goes to Wikipedia's disambiguation page.
Juha Syrjälä
Why do you say Lisp is only good for AI? Also, it's a multi-paradigm language. Functional is only one of the several paradigms it enables.
Luís Oliveira
I didn't say its only used for AI, I said one of its main uses is AI. Did you read it?
Justin Bennett
"Please don't assume Common Lisp is only useful for Databases, Unit Test Frameworks, Spam Filters, ID3 Parsers, Web Programming, Shoutcast Servers, HTML Generation Interpreters, and HTML Generation Compilers just because these are the only things happened to be implemented in the book Practical CL"
Mikael Jansson
+1  A: 

@Justin:
It's probably worth noting that emacs core is written in C. But that's just nit-picking - all the commands are written in elisp.

Bernard
A: 

Syntax is irrelevant, readability is not!

kokos
Yeah! And COBOL rules!
Peter
+3  A: 

@lassevk It only looks hard because you aren't using common indentation conventions (note, this isn't quite right because the preview lies a little; the r's should align with the fns in the recursive quicksort argument)

(defun quicksort (lis) 
  (if (null lis) 
      nil
      (let* ((x (car lis)) 
             (r (cdr lis)) 
             (fn (lambda (a) 
                (< a x))))
         (append (quicksort (remove-if-not fn 
                                     r)) 
                 (list x)
                 (quicksort (remove-if fn 
                              r))))))
John the Statistician
"It only looks hard because you aren't using common indentation conventions "Uh, no, it looks hard because unlike most modern languages it is not easily human-readable or self-describing. I can infer what it does and why from having worked professionally in several other languages but would not want to have to modify or explain in any detail what it's doing. Compare to something like VB.net or Ruby. I don't know Lisp and maybe it's an intentionally brief and oversimplified example but the difficult appearance is certainy not limited to its indentation.
FerretallicA
I think there is a fair criticism in what you say. I only mean to say "it looks much harder as you've presented it, and looks much clearer as it is presented here". I think that you would have to agree that many languages look a lot more confusing if their indentation conventions are not followed. Further, if we compare the indentation of, say Java and Lisp, I would say they generally require about the same level of knowledge of the basic constructs of each language to indent them correctly. But, it's fair, although entirely subjective, to say it still looks hard.
John the Statistician
I think an interesting comparison is between Lisp and XML (and it's associated tools). That isn't to say one shouldn't also to compare it to Ruby, VB.net, and so forth, but it's a different angle that I think helps illustrate what people who like Lisp like about it.
John the Statistician
+7  A: 

I programmed in Lisp professionally for about a year, and it is definitely worth learning. You will have unparalleled opportunity to remove redundancy from your code, by being able to replace all boilerplate code with functions where possible, and macros where not. You will also be able to access unparalleled flexibility at runtime, translating freely between code and data. Thus, situations where user actions can trigger the need to build complex structures dynamically is where Lisp truly shines. Popular airline flight schedulers are written in Lisp, and there is also a lot of CAD/CAM in Lisp.

John the Statistician
+4  A: 

I found that learning a new language, always influences your programming style in languages you already know. For me it always made me think in different ways to solve a problem in my primary language, which is Java. I think in general, it just widens your horizon in term of programming.

david
+3  A: 

If you have to ask yourself if you should learn lisp, you probably don't need to.

I'd say the opposite: if you already understand lisp because you have experience with a similar language then it's probably not necessary. If you don't understand what lisp has to offer, then you could benefit from the exposure.
Mr Fooz
+2  A: 

Learning lisp will put Javascript in a completely different light! Lisp really forces you to grasp both recursion and the whole "functions as first class objects"-paradigm. See Crockfords excellent article on Scheme vs Javascript. Javascript is perhaps the most important language around today, so understanding it better is immensely useful!

Erlend Halvorsen
The most important language? I think not, sir.
TraumaPony
Well, it's available on pretty much any device that has a web browser (and probably a few that don't), so as far as languages for running end user applications go, it has probably the highest penetration of any programming language on the planet. Obviously you could have an entirely different opinion on what's important. Will it be used to cure cancer? Probably not. But, like it or not, it will be one of the corner stones of (web) application development for years to come.
Erlend Halvorsen
+1  A: 

This is a topic i myself have pondered for a while but I have not really come to a decision, as usual time is the main problem... ;)

And since I can´t find these links sofar in this post i add them for public interest:

Success and Failure story: Lisping at JPL

Really impressive success story: Lisp in use at the Orbitz corporation

Comparison and analysis of whether to use Lisp instead of Java: Lisp as an Alternative to Java

pp
+2  A: 

If you like programming you should learn Lisp for the pure joy of it. XKCD perfectly expresses the intellectual enlightenment that ensues. Learning Lisp is for the programmer what meditation is for the Buddhist monk (and I meant this without any blasphemous connotation).

Konrad Rudolph
+2  A: 

To add to the other answers:

Because the SICP course (the videos are available here) is awesome: teaches you Lisp and a lot more!

OysterD
+2  A: 

Killer app? Franz Inc. has a long list of success stories, but this list only includes users of AllegroCL... There are probably others. My favourite is the story about Naughty Dog, since I was a big fan of the Crash Bandicoot games.

For learning Common Lisp, I'd recommend Practical Common Lisp. It has a hands-on approach that at least for me made it easier than other books I've looked at.

vetler
+6  A: 

Lisp is very useful for creating little DSLs. I've got a copy of Lisp in a Box running at work and I've written little DSLs to interrogate SQL server databases and generate data layers etc in C#. All my boiler plate code is now written in lisp macros that output to C#. I generate HTML, XML, all sorts of things with it. While I wish I could use Lisp for everyday coding, Lisp can bring practical benefits.

Phil Bennett
I use http://dotlisp.sourceforge.net/dotlisp.htm for this.
Mark Hurd
+2  A: 

I took a "lisp class" in college back in the eighties. Despite grokking all the concepts presented in the class, I was left without any appreciation for what makes lisp great. I'm afraid that a lot of people look at lisp as just another programming language, which is what that course in college did for me so many years ago. If you see someone complaining about lisp syntax (or lack thereof), there's a good chance that they're one of those people who has failed to grasp lisp's greatness. I was one of those people for a very long time.

It wasn't until two decades later, when I rekindled my interest in lisp, that I began to "get" what makes lisp interesting--for me anyway. If you manage to learn lisp without having your mind blown by closures and lisp macros, you've probably missed the point.

fdesmet
I second that. I'm currently on my second foray in to Lisp, 5 years out of school. One term of Lisp when you're still green may not have adequate effect -- I remember focusing only on the metaprogramming, and didn't yet have appreciating for the metaprogramming and flexibility.
Aaron
+21  A: 

Lisp is a large and complex language with a large and complex runtime to support it. For that reason, Lisp is best suited to large and complicated problems.

Now, a complex problem isn't the same as a complicated one. A complex problem is one with a lot of small details, but which isn't hard. Writing an airline booking system is a complex business, but with enough money and programmers it isn't hard. Get the difference?

A complicated problem is one which is convoluted, one where traditional divide and conquer doesn't work. Controlling a robot, or working with data that isn't tabular (languages, for example), or highly dynamic situations.

Lisp is really well suited to problems where the solution must be expandable; the classic example is the emacs text editor. It is fully programmable, and thus a programming environment in it's own right.

In his famous book PAIP, Norvig says that Lisp is ideal for exploratory programming. That is, programming a solution to a problem that isn't fully understood (as opposed to an on-line booking system). In other words: Complicated problems.

Furthermore, learning Lisp will remind you of something fundamental that has been forgotten: The difference between Van Neumann and Turing. As we now, Turing's model of computation is an interesting theoretical model, but useless as a model for designing computers. Van Neumann, on the other hand, designed a model of how computers and computation were to execute: The Van Neumann model. Central to the Van Neumann model is that you have but one memory, and store both your code and your data there. Notice carefully that a Java program (or C#, or whatever you like) is a manifestation of the Turing model. You set your program in concrete, once and for all. Then you hope you can deal with all data that gets thrown on it.

Lisp maintains the Van Neuman model; there is no sharp, pre-determined border between code and data. Programming in Lisp opens your mind to the power of the Van Neumann model. Programming in Lisp makes you see old concepts in a new light.

Finally, being interactive, you'll learn to interact with your programs as you develop them (as opposed to compile and run). This also change the way you program, and the way you view programming.

With this intro I can finally offer a reply to your question: Will you find places where it outshines "traditional" languages?

If you are an advanced programmer, you need advanced tools. And there is no tool more advanced than Lisp. Or, in other words: The answer is yes if your problems are hard. No otherwise.

"but with enough money and programmers it isn't hard" -- that said, given sufficiently many programmers it becomes impossible ;-)
Jonas Kölker
+1  A: 

You could use Clojure today to write tests and scripts on top of the Java VM. While there are other Lisp languages implemented on the JVM, I think Clojure does the best job of integrating with Java.

There are times when the Java language itself gets in the way of writing tests for Java code (including "traditional commercial programming"). (I don't mean that as an indictment of Java -- other languages suffer from the same problem -- but it's a fact. Since the topic, not Java, I won't elaborate. Please feel free to start a new topic if someone wants to discuss it.) Clojure eliminates many of those hindrances.

+12  A: 
Marcio Aguiar
+1  A: 

Not a reason but (trivial) AutoCAD has LISP & DCL runtime support. It is a convenient way to write complex macros (including ActiveX automation) if you don't want to use VBA or their C++ or .NET SDKs, or if a DIESEL expression doesn't cut it.

A lot of AutoCAD's functions are actually LISP routines.

CAD bloke
+1  A: 

Gimp's Script-Fu is lipsish. That's a photoshop-killer app.

Peter Turner
A: 

Lisp can be used anywhere you use traditional programming. It's not that different, it's just more powerful. Writing a web app? you can do it on Lisp, writing a desktop application? you can do it on Lisp, whatever, you can probably do it on Lisp, or Python, or any other generic programming (there are a few languages that are suited for only one task).

The biggest obstacle will probably be acceptance of your boss, your peers or your costumers. That's something you will have to work with them. Choosing a pragmatic solution like Clojure that can leverage the current install base of Java infrastructure, from the JVM to the libraries, might help you. Also, if you have a Java program, you may do a plug-in architecture and write Clojure plug-ins for it and end up writing half your code in Clojure.

J. Pablo Fernández
+1  A: 

Learning LISP/Scheme may not give you any increased application space, but it will help you get a better sense of functional programming, its rules, and its exceptions.

It's worth the time investment just to learn the difference in the beauty of six nested pure functions, and the nightmare of six nested functions with side effects.

J.T. Hurley
A: 

Not saying this is a killer app but it looks like it could be cool http://code.google.com/p/plop/

Dan Malkinski
A: 

Killer app? The flight search engine by ITA Software is one.

As for "why", it will most probably make you a better developer and is extremnely unlikely to make you a worse one. It may, however, make you prefer lisp dialects to other languages.

Vatine
A: 

From http://www.gigamonkeys.com/book/introduction-why-lisp.html

One of the most commonly repeated myths about Lisp is that it's "dead." While it's true that Common Lisp isn't as widely used as, say, Visual Basic or Java, it seems strange to describe a language that continues to be used for new development and that continues to attract new users as "dead." Some recent Lisp success stories include Paul Graham's Viaweb, which became Yahoo Store when Yahoo bought his company; ITA Software's airfare pricing and shopping system, QPX, used by the online ticket seller Orbitz and others; Naughty Dog's game for the PlayStation 2, Jak and Daxter, which is largely written in a domain-specific Lisp dialect Naughty Dog invented called GOAL, whose compiler is itself written in Common Lisp; and the Roomba, the autonomous robotic vacuum cleaner, whose software is written in L, a downwardly compatible subset of Common Lisp. Perhaps even more telling is the growth of the Common-Lisp.net Web site, which hosts open-source Common Lisp projects, and the number of local Lisp user groups that have sprung up in the past couple of years.

krdluzni