I ask the question because you can achieve the same results in most dynamic languages by grabbing the string representation of a function, run it through a parser, modify the resulting AST and then regenerating the function string before passing to an eval (CoffeeScript being a good example of this approach). Sure, it's messier than in Lisp, but in return for the messiness of macros, you get much easier to read syntax in most of your code. Is the use of macros really such a big part of Lisp programs that it justifies the lack of syntax everywhere else?
What's Special About Lisp?
41–50 of 69 posts
Re: What's Special About Lisp?
#42Earlier quoted context omitted.
well, if it's a language for writing libraries - why there are no libraries? :)
popularity, culture and ease of sharing libraries(ex. cpan) for one. But also its not that its great for writing libraries but that its great for writing libraries that extend the language.
Re: What's Special About Lisp?
#43I 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.
The state allows parts of program to communicate through implicit information channel. One part of program could signal another to increment a variable by deleting a file. Or vice versa.
That's why I think Haskell is the best for libraries, Scala less so and Lisp even lesser, even taking into account macro system, code-as-data, etc.
Re: What's Special About Lisp?
#44From 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]…
In any case, this is very much a question of discourse. For historical reasons Lisp (at least Common Lisp) seems to have this reputation of being associated with deadly serious people, or alternatively smug lisp weenies, while Ruby people talk about how happy it makes them feel all the time, even though there are plenty of people who clearly have fun with Lisp (even "crufty" "old" CL), and I'm sure many people would regard working with Ruby a chore. I mean, to each his own, I honestly can't imagine there's an objective scale on which CL (much less exciting new languages like Clojure) is "less fun" than Ruby. Things like homoiconicity, on the other, are objective criteria for comparing languages. There are plenty of reasons to like (say) Python better than (say) CL, but to say that homoiconicity or restarts or MOP are no big deal because if you try hard enough you can replicate 95% of that functionality in (say) Perl is a different question entirely.
Re: What's Special About Lisp?
#45I have a question for those that have done a lot of programming in Lisp: Is macro programming a really big part of Lisp programming? I mean, what percentage of a typical project would be macros? I ask the question because you can achieve the same results in most dynamic languages by grabbing the string representation of a function, run it through a parser, modify the resulting AST and then regenerating the function s…
user=> (macroexpand '(or true false))
(let* [or__3470__auto__ true] (if or__3470__auto__ or__3470__auto__ (clojure.core/or false)))
Also, I don't think that lisp "syntax" is unreadable, on the contrary.
Re: What's Special About Lisp?
#46Earlier 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.
[1] Even though it's trivial I still adore this simple example:
guile> (define D derivative)
guile> (define f (literal-function 'f))
guile> (define f^2 (expt f 2))
guile> (pe ((D f^2) 't))
(* 2 (f t) ((D f) t))
Add in the little things like being able to have boolean-returning-functions ending with '?', Lisp is very free.Re: What's Special About Lisp?
#47As pg says: "In 1960, John McCarthy published a remarkable paper in which he did for programming something like what Euclid did for geometry. He showed how, given a handful of simple operators and a notation for functions, you can build a whole programming language. [...] It's worth understanding what McCarthy discovered [my emphasis], not just as a landmark in the history of computers, but as a model for what programming is tending to become in our own time. " http://www.paulgraham.com/rootsoflisp.html
Why does pg say McCarthy discovered Lisp, not invented it? I think because it's something of such simplicity that one can imagine others inventing the same thing. So if humans contacted intelligent aliens, it wouldn't surprise me if they had independently invented Lisp, just as it wouldn't surprise me if they'd invented prime numbers, or cartesian co-ordinates.
Re: What's Special About Lisp?
#48I 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…
Counterexample: macros in Dylan (http://www.opendylan.org/books/dpg/db_329.html).
It's certainly true that Lisp's super-simple syntax makes it much easier to have a powerful macro system. Dylan macros are like Scheme's hygienic macros, based on pattern-matching and not as flexible as CL's fully general code-generating macros -- but still pretty powerful. (And there's an unofficial procedural macro system too, which I haven't looked at but I understand gives you CL-like power without too much pain.)
Re: What's Special About Lisp?
#49A 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…
Statements like "You can easily do this is Ruby" hint that author understood exactly nothing and focused on some random uninteresting example code while missing big picture.
Does Ruby have COND?
If it doesn't, can one implement it using existing Ruby constructs?
If it does, can one implement it using existing Ruby constructs except COND?
Re: What's Special About Lisp?
#50I have a question for those that have done a lot of programming in Lisp: Is macro programming a really big part of Lisp programming? I mean, what percentage of a typical project would be macros? I ask the question because you can achieve the same results in most dynamic languages by grabbing the string representation of a function, run it through a parser, modify the resulting AST and then regenerating the function s…