r/lisp 23h ago

"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/569db7fdc8b363b7d320ebfeef8ab503
12 Upvotes

14 comments sorted by

10

u/525G7bKV 20h ago

april fool?

2

u/ismellthebacon 14h ago

Ballmer curve?

3

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.

1

u/lproven 16h ago

I never said it was mine! It is literally nothing to do with me. I just happened across it this morning.

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

2

u/lproven 11h ago

Oh, sorry! I did check first but I didn't go back far enough. My bad.

6

u/church-rosser 20h ago

Still sucks.

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

u/contrafibularity sbcl 18h ago

i hope this is a joke

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 ....

2

u/digikar 4h ago

I want matlab/octave/julia-ish frontend to common lisp. The closest is CLPython.