Live data from Hacker News

What's Special About Lisp?

kresimirbojcic.com

11–20 of 69 posts

Re: What's Special About Lisp?

#11
post #7
post #3

Earlier quoted context omitted.

Being a Lisp enthousiast myself I often find those LISP elitists are people new to the language repeating the tired arguments we have heard so often before.

I'm learning clojure, and find it has a certain elegance, but I don't fully "get it" yet.

[deleted]

Re: What's Special About Lisp?

#12
From one page the author linked to [1]:

"Because coders DO NOT LIKE LISP. Most programmers find Lisp unpleasant and unnatural to use. They're not idiots, they're not ignorant, and they're not willfully choosing a less-powerful or less-efficient tool, they're choosing tools based on what makes them productive and happy."

The "profound enlightenment experience you will have when you finally get [functional programming]" [2] is a mystery that I've been trying to figure out, albeit slowly since the day only has 24h. I've gone through the Peepcode video on Clojure and I couldn't find an answer, and I didn't even feel attracted to the language, quite unlike my first Ruby experience.

Then the other day I watched Matz - creator of Ruby - talking about Ruby 2.0, and he used the word "happy" multiple times to explain how he wants developers to feel when using his language, and I thought of how brilliantly he's succeeded. I have now spent more time coding in Objective-C than any other language (iOS development), and every hour I code Objective-C I miss Ruby and how happy it makes me feel.

I find that happiness is highly overlooked in discussions about programming.

[1] http://discuss.joelonsoftware.com/default.asp?joel.3.371875....

[2] http://www.paulgraham.com/avg.html

(edit: formatting)

Re: What's Special About Lisp?

#13
post #5

The macro example used is meant to be instructive, not a demonstration of how powerful macros could be. Consider https://gist.github.com/1119534 , which demonstrates a pattern-matching syntax that (at compile-time!) constructs a minimal traversal of the data structure to find a match. The only way to do this in a language without macros is to write your own compiler.

Or Shriram Krishnamurthi's Automata via Macros - a beautiful little nontrivial example of Scheme macros:

http://www.cs.brown.edu/~sk/Publications/Papers/Published/sk...

Re: What's Special About Lisp?

#14
I feel for the author and have recently come to a similar (read: not same) conclusion: Lisp is pretty crappy for maybe 90% of the work being done out there. The more easily-accessible and popular a domain is, the worse Lisp will be for it. This isn't because Lisp magically gets worse; it's because other languages get better, through libraries. Even if nine of ten libraries are crappy, there are enough people in the space (remember, it's a popular domain) that something good will come out of it, and eventually everyone will basically settle on a few good choices.

Lisp programmers, when using Lisp for what it's best at, don't use libraries. There are no libraries for what they want to do, because what they're doing is obscure and/or hard.

Lisp is best at doing new things that have never been done before, because it's basically a language for writing libraries. As such, it prospers in unpopular fields.*

This makes it hard for lisp evangelists to be taken seriously. If you're to show someone a hard graphics problem written in lisp vs ruby, your reader has to understand graphics programming first. But calculating primes? Anyone can do that. Which example do you think will get more mindshare?

To summarize: Lisp is great at things you don't hear about.

* One reason Viaweb succeeded using Lisp for the web was because the web was still this exciting frontier and no one had really done anything with it yet. I'd go so far as to say that Viaweb wouldn't succeed today---they'd get trashed by the likes of Weebly, which is written in php for crying out loud.

Re: What's Special About Lisp?

#15
I do love ruby and feel that it's metaprogramming techniques to allow you to easily emulated many features of Lisp's macros.

That said the author missing an obvious thing here. They key with macros is that they allow you to alter syntax (not calculate values as many who try initially misunderstand them), and s-exps are essential to being able to do this (because they are effectively an abstract syntax tree).

I say this is obvious because the example itself demonstrates this. The lisp code in the end looks very much like the ruby. Being able to extend syntax means that if you like ruby you can make your lisp work more like it. Now try to reverse this example, make a ruby library that emulates a lisp style, I think you'd find it much more difficult, and expensive.

The other important thing to not forget is that this syntax transformation happens at compile time. One of the reasons that Ruby has a reputation for being slow is it has to keep track of a lot of metadata and all sorts of look-ups to do a lot of the metaprogramming (which is why people should make better use of it, you've already paid for it). In Common Lisp all this transformation is free during runtime. Think of a common issue with JavaScript: no implicit return. If Lisp did not have implicit return you could define a macro 'defr' which allowed you to define functions like you normally do, but always know they return a value. Instead you need to use CoffeeScript.

Finally people do still write plenty of Common Lisp, they're just a smaller community. Not long ago I wrote myself a very practical tool to process a specific file format, with it's own mini-dsl, an order of magnitude faster than similar libraries (albeit with intentionally less functionality) and all in 200 lines of Common Lisp.

Re: What's Special About Lisp?

#17
post #12

From one page the author linked to [1]: "Because coders DO NOT LIKE LISP. Most programmers find Lisp unpleasant and unnatural to use. They're not idiots, they're not ignorant, and they're not willfully choosing a less-powerful or less-efficient tool, they're choosing tools based on what makes them productive and happy." The "profound enlightenment experience you will have when you finally get [functional programming]…

Since Lisp, Smalltalk and Matz came up, I remembered what Matz said[1]:

Some may say Ruby is a bad rip-off of Lisp or Smalltalk, and I admit that. But it is nicer to ordinary people

[1] http://www.paulgraham.com/quotes.html

Re: What's Special About Lisp?

#18

I feel for the author and have recently come to a similar (read: not same ) conclusion: Lisp is pretty crappy for maybe 90% of the work being done out there. The more easily-accessible and popular a domain is, the worse Lisp will be for it. This isn't because Lisp magically gets worse; it's because other languages get better , through libraries. Even if nine of ten libraries are crappy, there are enough people in the…

well, if it's a language for writing libraries - why there are no libraries? :)

Re: What's Special About Lisp?

#19
post #12

From one page the author linked to [1]: "Because coders DO NOT LIKE LISP. Most programmers find Lisp unpleasant and unnatural to use. They're not idiots, they're not ignorant, and they're not willfully choosing a less-powerful or less-efficient tool, they're choosing tools based on what makes them productive and happy." The "profound enlightenment experience you will have when you finally get [functional programming]…

> The "profound enlightenment experience you will have when you finally get [functional programming]" [2]

Nitpick: the quote is not exactly about functional programming, it's about Lisp. Though Lisp is often used as a functional language, there are very lisp-ish features such as macros and the (lack of) syntax that you will not necessarily find in other functional languages.

That said, if you want to learn functional programming but are put off by Lisp's feel, you could try Haskell or OCaml or F#.

Re: What's Special About Lisp?

#20
I had similar thoughts when I was first learning a lisp. Unlike the author, I was enamored with the lack of syntax and the expressive power that was there. Sure, it's a Turing-complete language like any other, but for me it was a pleasure to hack with. Not only that, but you can actually do things with it (manipulate the language itself, from within the language itself…whoa) that I would only later realize the power of. Turns out you rarely need to use that power.

For instance, I'd do (untested):

    (defn prime? [x] (every? (fn [n] (not (zero? (mod x n))))                                                                                     
                             (range 2 (Math/sqrt x))))                                                                                            
                                                                                                                                                  
    (doseq (map pr (filter prime? (range 0 20)))) 
for the same effect. And I really was happy to write that. It makes sense.

NB: I'd never put such code into production, and I think it should be a warning sign that a purported problem in a language/dialect be based around minimal experience regarding an example.

Post reply on HN