Live data from Hacker News

What's Special About Lisp?

kresimirbojcic.com

21–30 of 69 posts

Re: What's Special About Lisp?

#21

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…

From what I've seen this role is now played as much, if not more, by languages like Scala and Haskell. Certainly languages like that owe a large debt to Lisp but I'm not so sure what you say is as true of Lisp today as it once was.

Re: What's Special About Lisp?

#22
A ton of responses and no one mentions the one-word answer?

"homoiconicity": the property of a language whereby code written in said language is stored, in a natural and immediate fashion, as a data structure of the same language

What this means for Lisp is that if you want to manipulate Lisp code, you aren't dealing with some crazy complex AST: you can actually /see/ how the code is parsed by looking at the code itself, as the code is actually typed using the serialization format for the primary data structure of the language: S-expressions.

So, you aren't just creating a little "DSL" by using some built-in syntax tricks like "implicit last argument block", but instead are able to write code that modifies code and generates code as easily as if you were writing the original code in the first place: the comparison to Ruby is therefore fundamentally flawed.

(Finally, as an unrelated bonus: the parser for Lisp is also written in Lisp and available during the execution of Lisp, so you can have code that modifies and extends the parser itself allowing you to fundamentally alter the syntax to, for example, look like Ruby; this mechanism is called "reader macros", for the record.)

Re: What's Special About Lisp?

#23
post #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? :)

I think I'm pretty safe saying there are a ton. Every Lisp hacker has their own.

Actually, "library" is probably the wrong word for reused Lisp code. A library is a public thing, an institution---and all that goes with it: slow to change, must be easy to understand, etc.

Instead of libraries, Lisp hackers have private collections. Like a messy desk, they are often supremely useful once you get the hang of it, but are inscrutable to others. Not exactly the best characteristics to get popular on github.

Re: What's Special About Lisp?

#24
Having spent 3 years with Clojure, I believe that Lisp macros are just as powerful as they say. But no need to take my word for it ... checkout the paper "Languages as Libraries" by the folks behind Racket.

I've created 3 libraries that I think would be exceedingly difficult, excruciating, or impossible to write with the performance and the level of control over syntax in anything but a very good Lisp:

http://github.com/clojure/core.logic, efficient embedded Prolog in 1K LOC

http://github.com/swannodette/match, in progress implementation of a state-of-the-art OCaml pattern matching algorithm

http://github.com/swannodette/delimc, delimited continuations

Re: What's Special About Lisp?

#26

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 th…

If you like Lisp, take a look at Clojure. I know it has been highly hyped here, but seriously, a very interesting language, which combines the beauty of lisp and practicality of java runtime.

(Edited: awkward English.)

Re: What's Special About Lisp?

#27

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…

Other languages certainly get better, and many can rely on extensive libraries.

That said, why not try Clojure? Best of both worlds, and then some.

Re: What's Special About Lisp?

#28
post #22

A ton of responses and no one mentions the one-word answer? "homoiconicity": the property of a language whereby code written in said language is stored, in a natural and immediate fashion, as a data structure of the same language What this means for Lisp is that if you want to manipulate Lisp code, you aren't dealing with some crazy complex AST: you can actually /see/ how the code is parsed by looking at the code its…

Please excuse my ignorance here --

> instead are able to write code that modifies code and generates code as easily as if you were writing the original code in the first place

Is this often done? I know it is conceptually possible with the advantage being that the same functions used to manipulate lists and data are available for this task, but I got the impression that not many people actually do this? For instance...

http://stackoverflow.com/questions/6480053/modifying-functio...

Re: What's Special About Lisp?

#29
post #22

A ton of responses and no one mentions the one-word answer? "homoiconicity": the property of a language whereby code written in said language is stored, in a natural and immediate fashion, as a data structure of the same language What this means for Lisp is that if you want to manipulate Lisp code, you aren't dealing with some crazy complex AST: you can actually /see/ how the code is parsed by looking at the code its…

Here's a hopefully fun example of a reader macro: http://paste.lisp.org/display/122860

Re: What's Special About Lisp?

#30
> You can fake it anywhere else with more or less work

That doesn't make sense, because there's no way to twist it. It's more work and duplication. I want macros all the time in JavaScript and that is a pretty flexible and dynamic language.

Most of Lisp's other features are common now. Macros are still a big one but you don't need them every day. Lisp has powerful exception handling but I'd rather have Erlang style error handling and recovery.

Lisp's draw is waning but only because our languages are lispy in ways that really matter. We have dynamic, garbage collection languages with REPLs and built in high level data structures that are even better because we have native syntax for them. I don't want to keep track of N different kinds of assoc lists... and I really like Lisp.

Post reply on HN