High-level languages like Ruby may contain lossy abstractions that obscure the low-level workings of the machine, but Lisp is another lossy abstraction that has the potential to obscure the high-level, abstruse workings of our own minds. Both of these abstractions can be valuable, but neither is without its shortcomings.
Sometimes ambiguity can be free, allowing indifference to how the machine works, without obscuring it at all. A good example is classical Hindley-Milner type inference (the algorithm that adds type annotations to plain System F code): it is fairly easy to construct oddball statements where annotating the types is undecidable or would cause resource exhaustion. But it turns out that for the known examples, it would be either impossible to decide the types in any form, or it would take O(c^n) bytes to enumerate the annotations.
So effectively there is no downside to the ambiguity -- the ambiguous statements are already infeasible for other reasons. Everybody Wins!
Intriguing. I'm not really convinced by your example though. In the spirit of conciseness is power[1], can you provide a short program that should be formally expressible in a good enough language, but isn't concisely in Lisp?
Or maybe your definition of low-level is different from mine?
[1] That's the PG version, of course.
My only problem with Lisp is that it's exactly the sum of its parts - no more, no less. Everything decomposes into self-similar pieces, which decompose into other pieces, and on and on, turtles almost all the way down. This is wonderfully elegant, but also feels like it precludes creating something which is more than the sum of its parts. This may not seem like a problem to a lot of people, or just sound like self-important nonsense, but the thing I enjoy most about programming is the tangible sense of gestalt you get when you've been working on a codebase for long enough. For me, Lisp doesn't provide that.
Yeah, I completely agree. I was going to write about it, but then figured it wasn't relevant to the question.
I'd love to discuss these old PG essays one day.
I am pretty new to programming, which means that I'm not stuck in conventions about how code syntax is supposed to be. On this background I find lisp pretty easy exactly because the syntax is so simple.
To me lisp is like chess: It's easy to grasp the basic rules, but hard to become a master.
1. So many parentheses!
2. You made a mistake right here.
Also, you might like this presentation, "The Swine Before Perl" by Shriram Krishnamurthi (of PLT). It's a great thing to show people who wonder how you could think Lisp has a good syntax: http://www.cs.brown.edu/~sk/Publications/Talks/SwineBeforePe...
(Also: SK's book is great.)
They force an inappropriate fundamental data type on everything, and are only of benefit if you want to fiddle with the insides of extant functions.
Use composition like a real FPer. Learn that there's so much more to data than lists + atoms.
Please explain.
(And I know composition, etc. I also use Haskell and Forth.)
'(GRAPH-EDGE <source-vertex> <target-vertex>)
whereas in ML you would write
type edge = { source: Vertex.t; target: Vertex.t }
which is not a list, but an entirely different representation. In Common Lisp the representation could of course be a CLOS object or a DEFSTRUCT (I think, my CL-fu is definitely not that good).
As for the composition, lisps are lacking (nice) currying which is one of the basic building blocks when constructing combinator-libraries.
The two comparing s-expressions ("ugly, evil, and an insidious plot hatched by misbegotten academics") and XML ("a hip, cool, great new idea") I found to be particularly brilliant.
There is something nice about a language (lisp) that doesn't look like anything else, in an artistic sense (not sure if that counts for much).
I think when most people complain about the parens, they are really complaining about the endless ))))))) at the end of an expression.
Meanwhile, we have no "dangling else" problem. Also, we have no need to memorize C's 15 levels of operator precedence, so when you see an expression, you never have to puzzle over how the items are grouped. In simple cases of C expressions, of course, it's easy, but it can get complicated. See "Java Puzzlers" by Josh Bloch and Neal Gafter to see how C/Java-style syntax can get you into trouble and fool you. There are pros and cons to each approach (C/Java and Lisp). I've used all of them extensively, and I prefer the Lisp way.