3 ms·
> 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 bu
by chriswarbo 8y ago
> 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.
- Readable http://readable.sourceforge.net http://readable.sourceforge.net
- Sweet expressions https://www.dwheeler.com/readable/sweet-expressions.html https://www.dwheeler.com/readable/sweet-expressions.html https://srfi.schemers.org/srfi-110/srfi-110.html https://srfi.schemers.org/srfi-110/srfi-110.html
- I-expressions https://srfi.schemers.org/srfi-49/srfi-49.html https://srfi.schemers.org/srfi-49/srfi-49.html
- Wisp https://srfi.schemers.org/srfi-119/srfi-119.html https://srfi.schemers.org/srfi-119/srfi-119.html http://www.draketo.de/english/wisp http://www.draketo.de/english/wisp
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.
- nojvek 8y agoOh wow. I-expressions. Didn’t know that was a thing. So clean and simple! I’m sold.