132

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 ?

StuartLC
  • 104,537
  • 17
  • 209
  • 285
David
  • 14,047
  • 24
  • 80
  • 101
  • 6
    Hard to be put off by what isn't there. – Kaz Sep 05 '12 at 17:34
  • Read [Philip Greenspun's resume](http://philip.greenspun.com/personal/resume). It is rife with real Lisp work. – Kaz Jun 18 '14 at 01:16
  • 1
    Also [here](http://philip.greenspun.com/personal/resume-list). Greenspun worked on packet switched network simulation, DSP design, processor design, VLSI layout, mechanical engineering automation, automation of earth moving, and on and on, all using Lisp or involving Lisp. He helped design Hewlett Packard's PA-RISC architecture using tools developed on a Lisp machine. – Kaz Jun 18 '14 at 01:21
  • Here are some apps developed in Lisp - Emacs, G2, AutoCad, Igor Engraver and Yahoo Store – Arulx Z Nov 22 '15 at 03:01

29 Answers29

135

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 Von Neumann and Turing. As we know, Turing's model of computation is an interesting theoretical model, but useless as a model for designing computers. Von Neumann, on the other hand, designed a model of how computers and computation were to execute: The Von Neumann model. Central to the Von 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 Von Neuman model; there is no sharp, pre-determined border between code and data. Programming in Lisp opens your mind to the power of the Von 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.

RudolfW
  • 564
  • 8
  • 13
user7517
  • 161
  • 2
  • 2
  • 2
  • 31
    "but with enough money and programmers it isn't hard" -- that said, given sufficiently many programmers it becomes impossible ;-) – Jonas Kölker Feb 26 '09 at 08:44
  • I've read about lisps' ability to generate code on the fly, but i've also read that it can be compiled.. are there implementations which can mix interpreted & compiled execution ? or which contain there own compiler ? – centaurian_slug Dec 05 '11 at 12:35
  • @centaurian_slug: Yes, absolutely. That's part of the power. Any version that hasn't been deliberately crippled will have its compiler/interpreter available at runtime. So, for example, a developer can log into a special connection on his web server, do some debugging, update some class and function definitions, and possibly recompile whatever was relying on those definitions if need be. All while the server's up and running. Probably not legal in an enterprise worried about SOX compliance, but that's one reason industries use braindead languages like Java and C# – James Mar 23 '12 at 14:05
58

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).

Robert Harvey
  • 178,213
  • 47
  • 333
  • 501
Justin Bennett
  • 8,906
  • 2
  • 27
  • 30
  • 6
    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 Sep 18 '08 at 08:48
  • 6
    I didn't say its only used for AI, I said one of its main uses is AI. Did you read it? – Justin Bennett Sep 18 '08 at 12:11
  • 33
    "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 Sep 20 '08 at 21:38
  • 23
    @JustinBennett yes you said it. Here: "In summary, learning Lisp (or Scheme) may not yield many practical applications beyond AI". I hate when people confrontate while being wrong. – Luka Ramishvili Nov 15 '11 at 12:21
58

In response to @lassevk:

alt text

Community
  • 1
  • 1
Marcio Aguiar
  • 14,231
  • 6
  • 39
  • 42
48

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
  • 21,347
  • 22
  • 80
  • 89
  • 3
    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 Mar 26 '09 at 17:34
  • @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 Aug 07 '08 at 23:56
  • 1
    It's almost fair to say emacs's C part is glue code. – Luka Ramishvili Nov 15 '11 at 12:38
  • 1
    According to the Emacs reference manual, "Most of the editing commands in Emacs are written in Lisp; the few exceptions could have been written in Lisp but use C instead for efficiency." https://www.gnu.org/software/emacs/manual/html_mono/emacs.html#Intro – dpritch Aug 04 '18 at 15:45
26

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
  • 18,893
  • 5
  • 49
  • 45
  • 3
    +1. This answer should mention Yahoo Stores, the first web app, was partially written in lisp. Quoting Wikipedia: In 1998, Yahoo! Inc. bought Viaweb for 455,000 shares of Yahoo! stock, valued at about $49 million, and renamed it Yahoo! Store. – Steven Lu Apr 04 '13 at 17:26
18

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 with waffle
  • 4,113
  • 21
  • 32
10

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
  • 4,809
  • 4
  • 30
  • 28
9

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
  • 530,221
  • 131
  • 937
  • 1,214
6

Any language looks a lot harder when one doesn't use the common indentation conventions of a language. When one follows them of Lisp, one sees how it expresses a syntax-tree structure quite readily (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 with waffle
  • 4,113
  • 21
  • 32
  • 2
    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 with waffle Feb 22 '10 at 17:27
  • 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 with waffle Feb 22 '10 at 19:54
  • 1
    To make it a bit simpler you could use the standard `let` and use a `defun` at the start of the function to define `fn` as it doesn't change. – Aaron Robson Aug 25 '12 at 21:12
  • If you don't know anything Lisp, you can still infer the structure of the above code. You know what goes with what, what is subordinate to what. You cannot say that about other languages which don't have this kind of syntax. If you don't know anything about them, you're completely lost. You don't know what goes with what, and can easily be duped into believing a visual lie like `int* x, y;`. – Kaz Sep 05 '12 at 17:42
  • 5
    @FerretallicA On what basis do you determine whether something is “easily human readable” or “self describing”? Similarity to English? Is Chinese “easily human readable”? What about mathematical notation? Is it “not easily human readable”? This sort of argument is annoying gibberish, because its hidden message is: “This doesn’t look like the way I first learnt to reason.” –  Jun 15 '13 at 16:15
  • 3
    More like your 'rebuttal' sounds like "Whinge whinge". Try the programming language sniff test. Take someone who hasn't programmed before and show them a page of VB code and a page of Lisp code. I'll happily bet my left nut on which of the two the casual observer will be more easily able to draw meaningful observations from. – nathanchere Jun 17 '13 at 14:49
  • 1
    I wonder what a Chinese, Japanese, Korean, Sumerian, Hindi or Arabic non-programmer would think of your rather brash desire to give up your testicle for a facile argument. –  Dec 24 '13 at 22:03
5

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
  • 799
  • 2
  • 9
  • 10
5

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
  • 521
  • 9
  • 12
5

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
  • 91
  • 2
  • 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 Dec 30 '08 at 05:20
5

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.

dlinsin
  • 19,249
  • 13
  • 42
  • 53
  • 1
    It's because you're a good programmer. Bad programmers, instead of influencing old skills with new knowledge, think in already known languages while writing in new ones. But why are you using Java after lisp? :) Java is hardest to use after Lisp, imo. – Luka Ramishvili Nov 15 '11 at 12:31
4

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
  • 957
  • 9
  • 14
  • 1
    The most important language? I think not, sir. – TraumaPony Nov 29 '08 at 04:58
  • 9
    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 Nov 15 '09 at 14:33
  • 1
    I went the same way! Although I was already using Javascript's functional and prototyping features, after learning Lisp Javascript was a new language nevertheless for me. – Luka Ramishvili Nov 15 '11 at 12:34
4

"Lisp is worth learning for the profound enlightenment experience you will have when you finally get it; that experience will make you a better programmer for the rest of your days, even if you never actually use Lisp itself a lot."

--Eric S. Raymond, "How to Become a Hacker"

http://www.paulgraham.com/avg.html

eric.christensen
  • 3,191
  • 4
  • 29
  • 35
4

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

  • 10
    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 Nov 26 '08 at 14:46
  • @MrFooz there is no similar languages that can remove the need to learn the lispy part of lisp. The main features of lisp are not found in any languages. Though most are. – Luka Ramishvili Nov 15 '11 at 12:36
  • Depending on your goals. If you want to die, you don't need to breath. But that doesn't mean that you shouldn't. – mimoralea May 27 '14 at 00:03
3

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

Peter Turner
  • 11,199
  • 10
  • 68
  • 109
3

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
  • 30,705
  • 58
  • 191
  • 286
3

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
  • 4,702
  • 1
  • 27
  • 19
3

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.

Csa77
  • 649
  • 13
  • 19
C Hogg
  • 1,001
  • 10
  • 15
2

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
  • 6,660
  • 5
  • 34
  • 33
2

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.

Vetle
  • 3,287
  • 2
  • 27
  • 28
2

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 customers. 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.

Mark Fisher
  • 965
  • 1
  • 11
  • 30
Pablo Fernandez
  • 279,434
  • 135
  • 377
  • 622
2

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.

1

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
  • 8,578
  • 7
  • 65
  • 114
1

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

PPS
  • 88
  • 10
0

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

Dan Malkinski
  • 235
  • 2
  • 3
  • 11
0

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
  • 20,782
  • 4
  • 54
  • 70
0

Syntax is irrelevant, readability is not!

kokos
  • 43,096
  • 5
  • 36
  • 32