6 ms·
You're over-generalizing. This is very much a matter of personal taste/inclination. Do ALL Lispers love the Lisp style of syntax? Of course not. Moreover, for
by horrido 10y ago
You're over-generalizing. This is very much a matter of personal taste/inclination. Do ALL Lispers love the Lisp style of syntax? Of course not.
Moreover, for many programmers, it's asking too much of them to wrap their heads around a syntax where you need to give it time for the parens to "fade" away. This cognitive hurdle is real and it's why Lisp isn't more popular.
Let's not bury our heads in the sand.
- lispm 10y agoIt's not just the parentheses. It's the whole code-as-data and interactive development thing. Code is different. Programming is different. Lisp uses different working styles and tools. You have to learn the whole set. It's possible to learn that and to learn it well, but it might take some time. Lisp code can be very readable, but it's also to write very complex code - more complex that in most languages, since Lisp provides many mechanisms under developer control.
- kazinator 10y agoEven if you don't care about using code as data, Lisp is simply more readable, period. You don't have to crack open a reference manual to look at grammar rules or precedence tables to work out what the shape of the syntax tree is; you can read anything just from the symbolic prefix, plus a smattering of minor notations like sharpsign-this and sharpsign-that. A programmer who doesn't know Lisp can still instinctively tell that in (foo (x y) (z w)), the x and y go together more tightly than foo and x, or y and z. The meaning is determined by foo. But foo is a word. And words have the nice property that you can look them up easily in manuals (potentially with just a mouse click). Those who say Lisp is not readable are trolls and liars. They are liars because they see it's obviously more readable, but it threatens their self-image of being a competent programmer. It does that because their self-image is rooted in having memorized a bunch of arcane syntax and believing that that is what makes a software developer. Look at this comment, for instance: https://news.ycombinator.com/item?id=12883362 https://news.ycombinator.com/item?id=12883362 "If only the LISP syntax looked like a programming language and made logical sense." Very good representative comment which captures the mindset aptly. A programming language can only possibly be legit only if programs in that look like what you already know.
- lispm 10y ago> You don't have to crack open a reference manual to look at grammar rules or precedence tables to work out what the shape of the syntax tree is; you can read anything just from the symbolic prefix, plus a smattering of minor notations like sharpsign-this and sharpsign-that. You can't. Any macro may support arbitrary syntax. If all you know is the macro name, you don't know nothing about the syntax it implements. > (foo (x y) (z w)) There are many many much more complex forms in Lisp. > And words have the nice property that you can look them up easily in manuals Then you have to read the syntax FOO implements. DEFGENERIC: defgeneric function-name gf-lambda-list [[option | {method-description}*]] => new-generic option::= (:argument-precedence-order parameter-name+) | (declare gf-declaration+) | (:documentation gf-documentation) | (:method-combination method-combination method-combination-argument*) | (:generic-function-class generic-function-class) | (:method-class method-class) method-description::= (:method method-qualifier* specialized-lambda-list [[declaration* | documentation]] form*) Then you need to know the set of precedence order names. What is a GF-DECLARACTION? What is a method-qualifier? what is the specialized-lambda-list? What are valid declaration expressions...? > Those who say Lisp is not readable are trolls and liars. I don't think you add credibility with these statements. Sorry, this is just dumb.
- kazinator 10y ago(defgeneric draw (thing on-what where)) (defmethod draw ((obj drawable) (where canvas) (location point)) ...) No brainer. Even though macros can contain any syntax, and in principle we can have a macro such that: (mac token1 token2 token3 ... tokenN) where the tokens are parsed according to some LALR(1) (or worse) grammar, in practice, macros are usually not designed that way. The nested list syntax is used for grouping units together. So without knowing what mac is, you don't know the semantics, but the structure is, more often than not, crystal clear. Of course you need the manual to know what they mean if you don't remember (gee, which is the class name and which is the instance, location or point?), but you don't have to implement the LARL(1) parser in your head.
- 10y ago
- kazinator 10y ago> This cognitive hurdle is real and it's why Lisp isn't more popular. Nobody has the answer why language or language family X isn't more popular. Thousands and thousands of languages have been invented since the dawn of computing. Only a handful are popular at any one time. Simply by probability and statistics alone, a language is unlikely to be popular. Some languages with awful, difficult syntax have enjoyed popularity. Perl became popular because of cryptic syntax. Cryptic syntax is what is populist, not clean syntax. Programming wannabes outnumber actual developers N:1 for rather large N. Programming wannabes feel smart when they remember and correctly use cryptic syntax. "Hey, look, I didn't use any parentheses in this because I memorized all 17 precedence levels!" "Wow, this linenoise-like sausage of symbols totally works! That is AWESOME!" "Bubble sort in 13 characters of code; I'm floored ...". C is popular because of the reverence for the tricks that it allows, like Duff's device: https://en.wikipedia.org/wiki/Duff's_device https://en.wikipedia.org/wiki/Duff's_device Lisp threatens these types of people whose competence is rooted in arcane syntax. It does that precisely because it's ultra-readable. Even if you've never programmed Lisp, you can probably guess what this does with great accuracy: (loop for x from 1 to 10 collecting x into list maximizing x into max finally (return (list max x))) You certainly won't stumble over any issues of cryptic syntax, or precedence or whatever. You might face an impediment if you don't speak English, due to that language being used to name symbols like "loop" and "collecting". People who claim that Lisp is not readable are disingenuous (promoting something else or jealously protecting their self-image of competence when the bulk of their CS and programming knowledge rests in the mastery of a handful of cryptic syntaxes), crazy/trolling or else cognitively different (such as dyslexics genuinely struggling with the syntax).