Hacker News new | past | comments | ask | show | jobs | submit login
Why Lisp is Awesome (atomized.org)
37 points by floater on Jan 6, 2010 | hide | past | favorite | 58 comments



This isn't why Lisp is awesome. This is why Lisp was awesome, back 50 years ago. Every single one of these features has since been adopted by mainstream scripting languages. What still sets Lisp apart is its metalinguistic capability - macros (hygienic or not).


but in one language?

The main difference between Lisp and most other languages out there is that Lisp has been designed for computing with symbolic data.

    (+ a b)  is a Lisp expression

    '(+ a b)  is Lisp data
This enables the easy manipulation and computation with symbolic expressions that stand for Lisp programs, algebra terms, theorems, logic expressions, rules, frames, music compositions, ... and many more.

Some languages have similar capabilities that can be used easily (Prolog, Mathematica, ...). Some have it in difficult variants, where one has to deal with complex representations. Others simply represent programs as strings and not more.


I was specifically writing about features Lisp pioneered which other languages adopted. I think it's enlightening to understand the roots and history of things, and fint it amazing that such an old language pioneered so many fundamental constructs.

Perhaps by 2059, we'll have languages with macros and regular syntax.


> Perhaps by 2059, we'll have languages with macros and regular syntax.

Boo has macros ... http://boo.codehaus.org/Language+Guide (at the end, under 'advanced features'.


C has macros.


Why would adopting language X's features make X less awesome?


Because awesome is usually used in a relative sense -- something is awesome compared to other stuff.

The implicit other stuff is "everything else."


You are making that up. Awesome is a description like 'green'.

    Yesterday we saw an awesome game.

    The sound of the new stereo is awesome.

    The view from that skyscraper is awesome.
If I compare something I'd say:

    Yesterday I saw the most awesome game.
etc.


Not really. Inspiring awe is a property based on when you see it. If you could demo an iphone to someone in 1970 it would be awesome; if you demo it to someone in 2015 it would be an old iphone.

Green is forever.



a Porsche from 1970 is still awesome. There are many things that have timeless qualities. Every time I hear 'The Man Machine' from Kraftwerk I think how awesome it is.

'The Grand Canyon is awesome' - how does that depend on WHEN I see it. As long as there is a Grand Canyon, it is awesome. It is of no concern if there are things less or more awesome. The Grand Canyon is just 'awesome'.

Lisp has for some people also timeless qualities. One of these people is Alan Kay (of Smalltalk, Dynabook, etc.) fame. Check some day what Alan thinks about Lisp: http://bc.tech.coop/blog/060224.html

"Most people who graduate with CS degrees don't understand the significance of Lisp. Lisp is the most important idea in computer science."


I can not think of a more clearly terrible example than Geology!

The Grand Canyon is in no way exempt from time -- millions of years ago it was just another unremarkable course of the Colorado River, and millions of years from now it will have eroded to nothingness. The Himalayas used to be an unremarkable coastline, and the Appalachians hills were once taller than Everest is now.


Awesome is an impression by a person that makes an observation. Millions ago the earth had no Grand Canyon (and thus could not be observed) and millions years ago there were no observers that could be impressed by something.

As long as there is a GRAND CANYON (a label for an observable geological feature given by man) the GRAND CANYON will be awesome. Your father found the Grand Canyon awesome and and your children will find it awesome, too. For us humans the Grand Canyon, as long it is there and as long we are there, is 'awesome'.

'Awesome' is an impression that humans have of something. It has nothing to do with geological timescales.


Unless there is an atomic spaceship war in a hundred years which scars the earth with canyons that size every few hundred miles. Then our grand children will not find "the Grand Canyon" awesome, they will find it "just another of those huge canyons that are everywhere and really boring".

Redwoods are awesome trees because of their size. If all other trees died out and Redwoods were the only tree, they wouldn't be awesome, they would be "normal tree size".

Unless you are high you don't go around being awe inspired by everyday things. Awesome is implicitly comparing with "everything else". Different things aren't awesome, but awesome things are different - but only while they are different.

> a Porsche from 1970 is still awesome

Not to me. A Veyron, now that's awesome. Spitfires are awesome, but only anachronistically - for their time and their reputation at the time - they don't hold a candle to a modern fighter.


I find a lot of cars awesome. Because they ALL have the SAME qualities that I like: excellent design, fantastic engineering, etc.

Sure, there might be cars with less fantastic engineering, those I might not find awesome. But it says nothing about that there is only a single thing of a certain type that I can find awesome or that other things are less or more awesome. 'Just awesome' stands for it alone.

No, I don't find the Veyron awesome. That's just butt ugly.

These are awesome cars:

http://www.ausmotive.com/images/Porsche-917-01.jpg

Especially the one in the front.


First time I went to New Mexico I saw some Kachini dolls. They looked, well, awesome.

After a few days or so, I saw many, many more Kachina dolls, such that I could start seeing differences in quality. Those first ones I saw? They really weren't all that awesome. They were actually sort of crappy, once I saw some truly awesome handiwork.

Whether or not something inspires awe really does depend on previous experience.


how are the Niagara falls less awesome on the 8.Jan 2010 compared to 7.Jan.2010?


You are misunderstanding his point. Lisp used to be awesome because it implemented feature X. That is, show people feature X in Lisp, and they would be impressed because nothing else did X.

Now, everything does X. Showing someone Lisp doing X will get the response of 'So what?'. Therefore, Lisp is no longer awesome because of feature X.


You are misunderstanding the original point. Lisp has certain qualities that are rare, designed in a special way and work together in special ways.

Almost none of the mainstream scripting languages uses simple code as data as Lisp does. Not Ruby. Not Python. Not PHP. Not JavaScript.

None of them have the roots in a meta-circular interpreter that fits on a page.

http://arcfn.com/2008/07/maxwells-equations-of-software-exam...

None of those allow me to write symbolic computations in a simple and straight forward way like I can do it in Lisp.

I find that awesome.


Which is different (entirely) from what the article was saying. It listed off several things which current languages do.

What (someone) up the chain was saying was exactly that. Lisp is interesting because of those things that it alone does. Not because it is capable of things that other languages do.


You're thinking way too small -- It's much more obvious if you'd use geological timescales to compare geological features.


Why should I do that? I'm a human. I find things I see awesome. I find all large 'falls' awesome. If the thing wasn't there a million years ago, who cares? I wasn't there also. But I'm here and some thing in the world can be observed by me as awesome. There are things that I might not find awesome after some years and there are other things that I find awesome for many years. Even if it is superseded by some newer stuff. The original iPod (I have one) is still awesome. It is a design classic. Timeless.


Nitpick: "dyanmic programming" does not meant what you think it means. http://en.wikipedia.org/wiki/Dynamic_programming


Risking being downmodded, I'd say Lisp is too "low level" for many common problems, which is great if your domain is parser/compiler construction/transformation/combination. I have no problem with lisp syntax (I can even tolerate C++ templates :), but it (and most general purpose languages) feels less natural for many domain specific problems than languages catering to the domains.

A DSL family based on a flexible core (with a lispish intermediate language even) might be a viable approach.

In many situations, simplicity and restrictions (constraints) in DSLs is better than flexibility and expressiveness in a general purpose language, because it can offer new possibilities for domain specific optimizations due to domain specific constraints.

Just like new notations in math led to breakthroughs in many math branches, new syntax can bring new life to software in many specific domains.

The key to such systems seems to be making DSLs easy to build and optimize using a suite of common building blocks (human (cs people) friendly intermediate languages (like lisp as opposed to VM byte codes) and libraries.)


That's why Lisp was called 'AI assembler'. Literally hundreds of higher-level languages have been implemented on top of Lisp. One of those has been integrated into Common Lisp: CLOS, a high-level object-oriented language for programming dynamic systems, with meta-programming capabilities.


Most of these "high-level" languages are more of "extensions" (CLOS certainly feels like an extension) or alternative lispish languages than bona fide DSLs with DS constraints (that can be used for DS optimizations). The S-expression syntax feels foreign/messy in many domains.


Languages on top of Lisp can be all from extensions, to languages with their own syntax, parser, compiler, ...

Examples for "high-level" languages on top of Lisp:

Macsyma, Axiom, Refine, AP5, RacerPro, CycL, NESL, Reduce, PVS, the original ML, ...

For a Lisp-like example see PDDL (Planning Domain Definition Language):

    (define (domain hanoi-domain)
            (:requirements :equality)
            (:predicates (disk ?x) (smaller ?x ?y) (on ?x ?y) (clear ?x))
            (:action move-disk
             :parameters (?disk ?below-disk ?new-below-disk)
             :precondition (and (disk ?disk)
                                (smaller ?disk ?new-below-disk)
                                (not (= ?new-below-disk ?below-disk))
                                (not (= ?new-below-disk ?disk))
                                (not (= ?below-disk ?disk))
                                (on ?disk ?below-disk)
                                (clear ?disk)
                                (clear ?new-below-disk))
             :effect (and (clear ?below-disk)
                          (on ?disk ?new-below-disk)
                          (not (on ?disk ?below-disk))
                          (not (clear ?new-below-disk)))))
Tools like these are widely used in logistics domains, one of the domains where Lisp has been widely used. There is a competition between planning systems and PDDL is being used to describe the problems.

For a non-s-expression domain specific language on top of Lisp see for example PWGL. It uses a graphical language. Also Macsyma/Maxima, and many many many others.


If anyone misses Geocities or myspace, look at this site in IE. I'm not sure what exactly the point of (seemingly) intentionally making your blog site readable in FF and outrageously hard to read in IE is...


I got tired of fixing layouts in IE and decided it would be more fun to break it instead.


That's certainly one approach.

From the outside, my interpretation of that is "I don't value my own opinion enough to make it accessible to users of other extremely common browsers."

I assume you blog because you feel like you have something to say that's worth reading. Making that content inaccessible to a very large segment of the browsers/users in the world works contrary to that. (I do sympathize with the PITA factor.)


That's too bad. I'm stuck at work and wanted to read this.


I think the point is clearly, "Fuck you, Internet Explorer." It's a sentiment many on the internet share.

I've got a few places where I simply block IE with stylesheets myself.


You're not a company man, aren't you? :)


I am more loyal than the sycophants who make excuses for shitty products. IE8 is not a good product, and it should be treated like an ugly leper until it gets its act together.


Seems entirely intentional...

  <!--[if IE]>
  <link rel="stylesheet" href="http://atomized.org/wp-content/themes/atomized2/ie.css type="text/css" media="screen">
  <![endif]-->
I find it pretty hilarious, myself. The site is quite nice in firefox, but I would have immediately turned away if I were using ie. He must be making some assumptions about his readers.


I wasn't aware you could use const char pointers in switch statements.

switch (var) {

    case "foo":
        printf("foo block.");
        break;

    case "bar":
        printf("bar block.");
        break;

    default:
        printf("Default case")
}


You can't:

$ cat foo.c

    #include <stdio.h>
    main() {
        const char *foo = "bar";
        switch (foo) {
            case "foo":
                printf("foo\n");
        }
    }
$ gcc -pedantic -std=c99 foo.c -o foo

    foo.c: In function ‘main’:
    foo.c:4: error: switch quantity not an integer
    foo.c:5: error: case label does not reduce to an integer constant


Sorry to make you put in so much work.

I'm aware that you can't do this.

I guess my sarcasm didn't translate:)


Many of these features are actually quite common in other languages. For example, C# has lambdas, functions as first class objects, closures, dynamic programming, null coalescence etc. The real power of Lisp in my opinion is not the existence of these features but the way they perfectly fit into the S-Expression syntax.


Right. Mainstream languages have been gradually evolving towards Lisp but until they adopt a simple uniform syntax they won't get real macros, which I think is the biggest difference between Lisp and other languages today.


I believe that appreciating Lisp's minimalistic, tree-like syntax requires a very mathematical way of thinking. Many (perhaps most) developers have a different way of thinking. There's nothing wrong with that, diversity is a good thing but because of that, I don't think that the S-Expression syntax will ever become "mainstream".


I think I agree... I'm undecided though. I actually find JSON to be a positive development, and potentially a step in this direction (i.e. the fact that people now use javascript literal data syntax as a way of serializing general data, and the syntax has been written down somewhere quite carefully and is not too verbose or ugly - at least compared to something like xml). Who knows how far the mainstream will take this though...


It is already.

XML is full of prefix, nested syntax.


Yes, but nobody would seriously write a programming language that used XML for its syntax.


So you say existing XML-based programming languages were 'written' by non-serious people?

'Water':

    <defmethod test_true source=required="ek_string"> 
     <try <if> source.<execute_string/>.<not/>   
                 <concat "Busted: "source/>.<print/>
               else “OK”
          </if>
    
       >
      <concat "Errored: " source/>.<print/>
     </try>
   </defmethod>
See also XSLT, XL, RuleML, ...


So you say existing XML-based programming languages were 'written' by non-serious people?

Whether or not the people who wrote (sorry, I guess "designed" is the more appropriate word) these languages were serious, I do believe they are a dead-end.


I think a better word would be "outfix".


The "switch statement" in C is closer to the CASE macro[1] in Lisp.

[1]: http://www.lispworks.com/documentation/HyperSpec/Body/m_case...


For the longest time I've heard that "Lisp is awesome", but no reasons why and when I've asked why, the answer is usually, "you have to try it to see it"

This article is a pretty nice down to earth point by point explanation why list is so cool. My question is: is that it ? lambdas, data is code, dynamic programing.. I mean those features are cool, but could someone post some more clear examples of why lisp is awesome?


See the HN-famous books "Structure and Interpretation of Computer Programs," "Paradigms of Artificial Intelligence Programming," and "On Lisp."

The claim is that Lisp is a language at a higher level of abstraction. You will have to study hard to be able to appreciate that level, but it cannot be explained in another way.

Imagine explaining Calculus to a high school Physics student. You're likely to get back: "But I can find the acceleration of an object by using normal algebra and subtracting its position at two different times!" Calculus is hard, its benefits are not clearly better than approximation or high school algebra until you reach a level at which you brain thinks of Calculus as fundamental and sees the old equations as merely derived, less-powerful versions.

Why would you expect a mind-expanding language to be any easier to explain?


Dude... that is a very good analogy! point well taken.


Also, it's worth noting that all three books implement a subset of Prolog (in Lisp). Prolog is another language which sounds really bizarre, but can be incredibly powerful. It's less general purpose than Lisp, though - essentially, it works by searching for answers that fulfill all criteria you specify, backtracking to (lazily) generate alternative answers as needed. It's conceptually really cool, and is great for prototyping certain kinds of problems. Some of the literature is also quite good, particularly _The Art of Prolog_ by Sterling & Shapiro.


This isn't an enumerated list, obviously, but it piqued my interest in Lisp, among other things:

http://wiki.alu.org/RtL_Highlight_Film


http://www.defmacro.org/ramblings/lisp-ducati.html

http://www.defmacro.org/ramblings/lisp.html

"""What would you rather do? Learn 16 different languages and frameworks in order to do "simple" log-file and configuration-file processing? Or just buckle down, learn Lisp, and have all of these problems go away forever?"""

http://steve.yegge.googlepages.com/the-emacs-problem


The above article (http://www.defmacro.org/ramblings/lisp.html) is excellent ! Thank you very much for the link.


Instead of cond, you can use a switch.. it makes it even more succinct. I don't know why this post is rated so high thought.. it's like a copy of the preface of any scheme book.


That switch statement doesn't work. You can't compare pointers(?) and string literals like that.


I'm not declaring the awesomeness or otherwise of Lisp but you're a shitty C coder :)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: