4 ms·
That's a lot of work to demonstrate that Lisp's syntax is less elegant than freaking ES6. > TThat assignment has 9 pieces of extra syntax Seeing as we're not
by abritinthebay 10y ago
That's a lot of work to demonstrate that Lisp's syntax is less elegant than freaking ES6.
> TThat assignment has 9 pieces of extra syntax
Seeing as we're not playing Code Golf that does t really matter does it? What it is is clearer, easier to understand, and actually built into the language.
Lisp is many things, syntactically elegant isn't one of them.
- deleted 10y ago[deleted]
- kazinator 10y agoI feel that I hadn't seen true beauty in a text editor window until I got involved with Lisp, and that EczemaScript is designed by imbeciles. I'm willing to try to put some kind of numbers on my point of view. Basically, it boils down to token counts and the presence of implicit associativity and precedence rules. We can remove four square parentheses from the [ a, b, c ] = [ 1, 2, 3 ] assignment, thereby significantly reducing the verbiage. However, we end up with ambiguity. There is no universal precedence between comma and assignment. For instance, in C (a language which indirectly inspired the syntax of ES), it is the other way: the expression a, b, c = 1, 2, 3 in C will perform only the c = 1 assignment. It's good that ES spends these extra tokens to reduce ambiguity here. Every extra token should count as one demerit point. Then, every instance in a sentence where an implicit rule must be invoked to disambiguate the parse should result in multiple demerits determined according to how the smallest number of grouping tokens would have to be inserted to remove the ambiguity. (That's being generous, because it doesn't take into account the work of determining the parse and doing the insertion.) So for instance "Buffalo buffalo Buffalo buffalo buffalo buffalo Buffalo buffalo" has a minimal number of tokens to express its meaning (which is good), but there is a significant cognitive load to figure out its structure from all the implicit grammar rules (bad). If we insert the parentheses we get "((Buffalo buffalo) (Buffalo buffalo) buffalo) buffalo (Buffalo buffalo)". Some functional languages have this "buffalo disease"; strings of words are just catenated, and working out all the partial applications that are buried in there and whatnot is a hairball.
- abritinthebay 10y ago> Basically, it boils down to token counts and the presence of implicit associativity and precedence rules. That's... a really arbitrary and contrived presumption. Not to mention presuppositional (and circular) in nature. "I define what makes a language beautiful as what Lisp is best at, therefore lisp is most beautiful." It's things like this which cause Lisp evangelists to not get taken seriously. Based on your comparison anyhow Python is much better with it's Tuples (ie - a, b, c = 1, 2, 3) and lisp would be fundamentally worse.
- kazinator 10y agoI see; so when you say things like 'Lisp is many things, syntactically elegant isn't one of them' you are taken seriously, whereas if I say the opposite I am not; and it's because I have tried to reflect over my biases, and quantify them in some sort of objectively evaluable terms.
- abritinthebay 10y agoNo, it's when you define "beautiful" as "equivalent to lisp syntax" that you are not taken seriously. Which you did. So you weren't.