Comment by jiyinyiyong
4 years ago
To explore ways of bringing Lisp to wider ranges of audiences, I prefer indentation based syntax like:
->
range 100
map $ fn (x)
* x x
foldl 0 &+
println
which is S-Expressions with indentations, with in-line paren pairs. It looks a lot like Python by still using prefixed operators and it's still S-Expressions after parsing to remain homoiconic.
And my prototype language http://calcit-lang.org/ .
I've used something like this for Lisp-family languages privately for decades.
[1] I like having a bar | open a parenthesis that closes automatically when the line or group ends.
[2] There are many Lisp/Scheme constructions that jump two deep without an intervening symbol. Rather that having to count out indents, it's very helpful and readable to have a dummy symbol as skeleton to reify the parenthesis structure. I like $ from Haskell.
Haha! The irony; I found your comment in a HN search for Lisp.
In the search result, your painstakingly indented code appears flattened to the left margin, destroying the correctness of its structure.
https://i.imgur.com/jAB0tBn.png
Just, no.
You are right. When tools are not being friendly to indentation based syntax, the code with indentations would be a mess. Parentheses and curly braces are lot like "defensive programming" against unfriendly tools.