I parse Lisp similar ways and speed as Python. The indentation in Lisp code is works the the same way.
Q: How can you tell when you've reached Lisp Enlightenment?
A: The parentheses disappear.
–– AnonymousI parse Lisp similar ways and speed as Python. The indentation in Lisp code is works the the same way.
Q: How can you tell when you've reached Lisp Enlightenment?
A: The parentheses disappear.
–– AnonymousIt is the unambiguous notation enabled by the parentheses that allow lisp to process code as data and construct programs on the fly.
IMHO, those who suggest eliminating the parentheses don't yet understand lisp. Trying to make lisp more widely acceptable by eliminating them is throwing the baby out with the bathwater.
IMHO, those who suggest eliminating the parentheses don't yet understand lisp.
What's wrong with the three equivalence transformations of OP? It's the same language, only that newline/indent serve as hidden parentheses. f(a b) == (f a b)
{a f b} == (f a b)
f
a b ≛ (f (a b))Objectively:
1. I can't look at a line and tell if I have a complete expression. I must look at the following line and compare its indention level to this line. I may also need to look at the previous line(s) to see if we've switched to infix unexpectedly.
2. Indention means your programs will be bigger in physical area (meaning more scrolling).
Pragmatically:
3. People are unable to reliably copy/paste indention-languages into many web forums (like HN and Reddit) making it harder for them to get the help they need when starting out.
4. It's slower and more complex to parse, making build/compile times slower.
Subjectively: It just looks worse.
Autoindent and paren matching is currently a basic feature of virtually all mainstream text editors. Therefore, picking up any random mainstream text editor is already enough to address your concerns.
They are disturbing only people who don't program with Lisp a lot.
Which is about 99.9% of the population. It's good for Lispers that they can ignore braces, but why ignore them when you can just drop them (in many cases), and thereby increase it's chance of mass adaptation.BTW, this post was an outcrop of another article "Why Lisp Failed (2010)" https://news.ycombinator.com/item?id=20374782
Agreed! For decades some people have said parens in S-Expressions are useless.
But a key thing we're pushing, that's never been pushed before, is that the parens are worse than useless--they are harmful! They prevent easier program concatenation and ad hoc parser writing. And they make program synthesis, visual programming, and code analysis ~10x harder, for next to no gain.
I'm hoping we'll start to turn the tide and bring the 99.9% of the population into the Tree Notation world, and those LISPers that love their parens can remain happily in their (world).
Almost everything you've said above is not just untrue, but the opposite of the truth. As such, your statements require supporting evidence. Please cite some.
And who, by the way, is "we"?
There is also a big open source release coming soon—the largest database of programming languages and features in the world by a factor of at least 10x, more like 100x. Over 10k languages, over 1k columns.
We is the Tree Notation Lab. Will be announcing what that is and the funding for it later this month.
This assertion is patently false. Parens make it quite trivial to parse and render the underlying tree structuee rather obvious. Concatenating programs is just a matter of splicing a subtree into the target tree.
Here's a proof.
- In S-Expressions with parens, there are infinite ways to write any given abstract syntax tree.
- In Tree Notation, there is only 1 way to write any given abstract syntax tree.
If you change one letter, you get a different tree.
- Say I wrote programs in a Tree Language with a root node called "dumpToConsole" and I want to
rename all such nodes to "print". I can write a type-safe ad hoc parser that does
a simple search replace "/\ndumpToConsole/print/",
using Tree Notation. If it were in S-Expressions, I'd have to use a full parser.There is no need to change Lisp into different language because they already exist. Trying to get people who don't want to learn Lisp to learn Lisp is pointless.