11 ms·
Why Lisp is Awesome
- clueless123 17y agoFor 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?
- asolove 17y agoSee 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?
- clueless123 17y agoDude... that is a very good analogy! point well taken.
- silentbicycle 17y agoAlso, 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.
- cylinder714 17y agoThis isn't an enumerated list, obviously, but it piqued my interest in Lisp, among other things: http://wiki.alu.org/RtL_Highlight_Film http://wiki.alu.org/RtL_Highlight_Film
- jodrellblank 17y agohttp://www.defmacro.org/ramblings/lisp-ducati.html http://www.defmacro.org/ramblings/lisp-ducati.html http://www.defmacro.org/ramblings/lisp.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 http://steve.yegge.googlepages.com/the-emacs-problem
- clueless123 17y agoThe above article (http://www.defmacro.org/ramblings/lisp.html http://www.defmacro.org/ramblings/lisp.html) is excellent ! Thank you very much for the link.
- DrJokepu 17y agoMany 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.
- abstractbill 17y agoRight. 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.
- DrJokepu 17y agoI 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".
- abstractbill 17y agoI 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...
- lispm 17y agoIt is already. XML is full of prefix, nested syntax.
- abstractbill 17y agoYes, but nobody would seriously write a programming language that used XML for its syntax.
- sokoloff 17y agoIf 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...
- jordyhoyt 17y agoSeems 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.
- ieure 17y agoI got tired of fixing layouts in IE and decided it would be more fun to break it instead.
- manicolosi 17y agoThat's too bad. I'm stuck at work and wanted to read this.
- sokoloff 17y agoThat'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.)
- KirinDave 17y agoI 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.
- 17y ago
- rntz 17y agoThis 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).
- joevandyk 17y agoWhy would adopting language X's features make X less awesome?
- apu 17y agoBecause awesome is usually used in a relative sense -- something is awesome compared to other stuff. The implicit other stuff is "everything else."
- lispm 17y agoYou 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.
- justinhj 17y agoNot 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.
- lispm 17y agoa 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 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."
- d0m 17y agoInstead 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.
- wendroid 17y agoI'm not declaring the awesomeness or otherwise of Lisp but you're a shitty C coder :)
- yuan 17y agoThe "switch statement" in C is closer to the CASE macro[1] in Lisp. [1]: http://www.lispworks.com/documentation/HyperSpec/Body/m_case_.htm http://www.lispworks.com/documentation/HyperSpec/Body/m_case...
- RedJones 17y agoWORST WEBSITE IN THE UNIVERSE
- scott_s 17y agoNitpick: "dyanmic programming" does not meant what you think it means. http://en.wikipedia.org/wiki/Dynamic_programming http://en.wikipedia.org/wiki/Dynamic_programming
- vicaya 17y agoRisking 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.)
- lispm 17y agoThat'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.
- vicaya 17y agoMost 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.
- lispm 17y agoLanguages 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.
- chollida1 17y agoI 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") }
- mbrubeck 17y agoYou 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
- chollida1 17y agoSorry to make you put in so much work. I'm aware that you can't do this. I guess my sarcasm didn't translate:)
- Locke1689 17y agoThat switch statement doesn't work. You can't compare pointers(?) and string literals like that.