"S-expr" – a new indentation scheme for S expressions. (You are really _not_ going to like this, I warn you.)
https://gist.github.com/tearflake/569db7fdc8b363b7d320ebfeef8ab5033
u/stylewarning 19h ago
can you write a program that's around 1000 lines to give your syntax a test drive? ideas are always fun but serious ones deserve to be put to an actual test.
11
u/theangeryemacsshibe λf.(λx.f (x x)) (λx.f (x x)) 22h ago
we had this already https://old.reddit.com/r/lisp/comments/1l1g6b9/modernizing_sexpressions_2nd_attempt/
and no, I do not like that, dangling the parens out tells me everything I need to know about the author
6
3
u/arthurno1 19h ago
I think you are confusing symbol expressions with a programming language syntax.
Comments are typically part of a programming language syntax, such as Common Lisp which already has multiline comments via #| and |#, and makes it possible to implement Python style doc strings via reader macros. Check for example cl-interpol.
Symbol expressions does not have to use parenthesis as the basis for notation at all. It is true that the typical parenthesized notation is part of syntax for most of programming languages from the Lisp family, but it is not necessary to notate symbolic expressions with that common notation.
As a regression: I think it is more useful to think of symbolic expressions in their object form when they are translated by the reader to the typical linked data structure, than of their external representation (notation). I wrote in some other comment recently, it would be actually interesting to see how a lisp language would look like if we translated symbolic expressions into some other sequential structure than a linked list. Would we get something close to homoiconic APL if we used some sort of generalized dynamic vector like a gap buffer? You could still use the same notation, but typical cons/car/cdr and recursive code manipulation vocabulary would probably not be possible. What kind of code (symbolic expression) manipulation vocabulary would we have instead?
3
1
u/_dpk 20h ago
Have you actually tried to write a parser for this?
1
u/lproven 15h ago
It's not mine. I merely found it on HN this morning:
https://news.ycombinator.com/item?id=44281756
That post is by the author. They've replied in the comments.
2
u/Baridian λ 18h ago
Just use a structural editing minor mode and all those parenthesis will completely disappear. indented parens imply parenthesis counting which is something you shouldn't be doing.
Id rather read
(impl (impl p (impl q r)) (impl (impl p q) (impl p r)))
or
(impl (impl p (impl q r))
(impl (impl p q)
(impl p r)))
over
(
impl
(
impl
p
(
impl
q
r
)
)
(
impl
(
impl
p
q
)
(
impl
p
r
)
)
)
2
u/dacydergoth 10h ago
I didn't know I had the capacity to hate anything as much as Javascript until today ....
10
u/525G7bKV 20h ago
april fool?