>More than anything else, I think it is the ability of Lisp programs to manipulate Lisp expressions that sets Lisp apart. And so no one who has not written a lot of macros is really in a position to compare Lisp to other languages. When I hear people complain about Lisp's parentheses, it sounds to my ears like someone saying: "I tried one of those bananas, which you say are so delicious. The white part was ok, but the yellow part was very tough and tasted awful." – Paul Graham
Lisp programmers don't deal with "parens hell". That's one of the misconceptions that come from outsider looking in. Parens are for the editor. Lisp indeed uses indentation and not parens as you said. It's very python-like that way."You have reached Lisp enlightenment when parens disappear"
I think it would be real helpful to have editor for beginners that shows parents as transparent and low contrast, separately from the rest of the code. It would help people to understand they should not be trying to match them visually.
Educated guess: because you have zero experience developing an application or utility program in a language in the Lisp family. Because then if you still harbored a caricature, it would probably be more sophisticated.
Because it’s just that, a caricature. Having spent enough time using sexps (primarily in Clojure) I’ve found that with a decent editor it is about identation and line breaks, which is generally true of most languages.
Parenthesis are one of the most elegant things about Lisp, and I would hate to have to live without them.
When I finally got around to learning Python, I found that its meaningful whitespace usually wasn't as bad as I'd feared, but it's still a pain in the ass in certain circumstances.
For instance, there are plenty of places online (like some blogs) where python code is published that screws up its whitespace so that copying and pasting from there totally screws up the program and I'm forced to fix it by hand. This is an unnecessary pain that explicit delimiters like Lisp's parenthesis solve.
Python's meaningful whitespace is also not enough for editing software to easily infer and manipulate the program's structure without actually knowing python. That's a burden that editors that are editing Lisp do not have, as they're always just going to be manipulating sexps, without needing a deep understanding of the underlying language. So that usually makes sexp-aware editors (and plugins like pariner) much more powerful and flexible when editing Lisp than your typical python editor.
Python also has way too many other types of delimiters. Though modern Lisps also don't have just parenthesis, most of their delimiters are parenthesis and that makes thinking about which delimiter is appropriate in which context a lot simpler. You have a lot less rules to remember, and that's a blessing if you're a polylingual programmer who's bouncing around from one language to another -- you mostly don't have to remember which delimiter has to go where, as it's mostly just a parenthesis with Lisp.
Instead of trying to improve Lisp by taking away parenthesis and adding meaningful whitespace, I'd rather improve Python by taking away its meaningful whitespace and using parenthesis.
> I love indented languages. Python, make, coffeescript etc indentation communicates hierarchy. It’s a very simple idea.
> All I’m saying is Lisp is amazing but parens aren’t for everyone.
It's trivial to write Lisp using indentation and no parentheses if you want to. The same goes for any language which uses s-expressions. Just pick an alternative syntax, e.g.
These can all be converted back and forth to s-expressions, such that the programmer doesn't have to care about s-expressions (found some code online? send it through a converter before reading it), and the language implementation doesn't have to care about the syntax that the programmer is using (set up the relevant converter as a preprocessor).
Two things to note:
- The reason we can do this is because s-expressions are such a useful language format. Using an alternative syntax for Python, make or coffeescript would be a time consuming, maintainence heavy burden. Anything using s-expressions gets all this "for free".
- The fraction of Lisp programmers who do this is vanishingly small. This is empirical evidence that parentheses are not a problem worth caring about.
As a lisp programmer at home, python programmer at work:
>I strongly believe python got so popular because of its very simple to read, almost pseudo-code like syntax that anyone could learn.
Agreed. And python programmers are asymptomatically approaching Lisp's features. I had previously thought that only Lisp dialects could do symbolic differentiation and integration on code written in the same language, but I was wrong.
http://www.sympy.org/en/index.html
> List had great ideas, everything is a list, but dealing with parens hell makes me think it could be a lot more elegant.
Lisp is already the most elegant. In John McCarthy's 1958 paper, he wrote a Lisp interpreter in Lisp, and the interpreter was only a page or two. That is elegance.
(This is not to belittle the point you are making, I just can't resist being That Guy. Lisp manages to be both a usable language and pretty easy to interpret, whereas Brainfuck is... something else.)
Parens are only useful if everything is on a single line. With new lines and indentation, things can become a lot cleaner like python style.
I strongly believe python got so popular because of its very simple to read, almost pseudo-code like syntax that anyone could learn.
List had great ideas, everything is a list, but dealing with parens hell makes me think it could be a lot more elegant.