Hacker News new | ask | show | jobs
by manifestsilence 2396 days ago
I think the appeal of the syntax for those who get used to it is the regularity, like you said.

The advantage of the regularity isn't its human readability, but its ability to macro, no?

What I'd like to see is better tools for reading and editing such a regular syntax. Probably I should just learn emacs, but I'm thinking someone could make a more intuitive structured editor for LISP syntax. No need to mush around blobs of text when everything is nested lists.

4 comments

> The advantage of the regularity isn't its human readability, but its ability to macro, no?

This.

You can write macros for less regular languages, but there's always additional friction involved. At some point, it comes down to whether you think LISP is a "programmable programming language."

If you do, macros are a core part of the paradigm, and s-exprs make macros easy to work with.

I already really liked Lisp's syntax before I learned about the macros.

No ambiguity; no brain cycles required to work out what element is a child or sibling of what element. Great editing ergonomics.

I would guess, based on the second and third sentences of the article, that the author agrees that this is the primary motivation:

> If you already love s-expressions then lisp-flavored languages will make it nicer when you need to build on existing platforms. In case the target language does not support advanced features like macros and REPL-driven development, these can often be easily added by using the s-expressions layer.

To the comment about "parenthesis-laden syntax", I find that, if I actually count the characters, my Java code tends to have just as many parens as my Clojure code. I suspect that there's just a tendency, if all you've ever known is algol-style syntax, to hyper-fixate on lparens that appear to the left of the function name. I think maybe the only programmers who get to criticize others for overuse of parenthesis are Forth, ML, and Haskell programmers.

Actually, in my experience detractors tend to fixate on the

    ))))))))))
that ends some lispy code.
Yet are completely fine with things like:

                  }
                })
              ]}
            }])
          }
        }
      }
   }
At the very least that is more readable due to the indents and the extra syntax. Depending on what language you're using, those different common groups of tokens do communicate context, whereas a dozen right-parens on a single line really don't.
For me personally the regularity is definitely a plus. Especially combined with an editor like paredit or smartparens it becomes very easy to move entire sections of code around.
I suppose that's a good point. Lisp programmers seem to enjoy macros quite a bit, and so I guess those things do work well together.