1. 30
  1.  

    1. 6

      Very similar in scope and a fantastic article: “An intuition for Lisp syntax” https://stopa.io/post/265

      1. 2

        I’ve always found it surprising that other languages don’t try to treat everything atomically when evaluated by themselves. Learning scheme and then clisp early in my programming days definitely gave me a different view of the world from the start, but I feel like it also clouded my vision a bit since there is no correlation whatsoever to the hardware the code runs on. Some might argue that this is actually better, but I think the next innovation will come from staring at how we could break up the compilation phase of code a bit more, which means thinking more about how we treat the machine as an abstraction in the context of the language.

        1. 2

          Yes! I’m working on this assumption right now!

          Current languages have gone to far into ahead of time, and uninteractive compilation. Zig is a step back in this direction, but lisp is usually the only real contender. Python and Smalltalk also are much closer

        2. 3

          Where postfix gang

          1. 2

            Forth and Factor?

          2. 1

            I always thought that significant indentation optionally replacing parens might make Lisps more readable for many. I know Racket has something like this… So for example, the example from the article:

            (if (= 5 5)
              (print "Sanity!")
              (print "Insanity!"))
            

            Would become:

            if
              = 5 5
              print “Sanity!”
              print “Insanity!”
            
            1. 6

              Postfix,

              5 5 = [ “Sanity!” ] [ “Insanity!” ] if print

              Now whitespace doesn’t matter and there’s even less syntax

              1. 4

                Or as the bumper sticker said: FORTH 🖤 IF HONK THEN

                Arguably even less readable, though, especially given conc. languages’ aversion to local variables, hence requiring mental effort to follow along with the stack contents.

                (Don’t get me wrong, I like these languages, but I see them more as a kind of high level assembly.)

                There’s also Smalltalk: (5 = 5 ifTrue: [“sanity”] ifFalse: [“insanity”]) print

                  1. 1

                    Looks interesting but I can’t find enough code or background on the choices. I can tell it’s a homebrewed language in a popular niche but I’m not familiar with that niche.

                    A GitHub or publicly viewable source repo would help, or a clear document on why the author doesn’t believe in it (I suspect).

                    1. 1

                      I mean, all the choices are really well explained near the top of the Latest Documentation, and there is a link to a lot of example code on the homepage - I’m not sure what you’re looking for. The source is in a .tar.gz linked from the homepage which isn’t a big ask.

                      1. 1

                        I don’t know how I missed that, I think I assumed it would be a changelog.

                        Looks really cool! Thanks

                1. 5

                  You may appreciate Wisp then.

                  1. 4

                    Or shrubbery notation, used in Racket’s Rhombus dialect.

                    1. 1

                      I think this is putting make up on a pig. I used to believe in significant whitespace but I think it’s important to allow code authors to express the code in the best form for reading. That doesn’t often fit with whitespace. The only exception is newline handling and occasional block indentation like do blocks in Haskell where it’s perfect

                    2. 3

                      I have been playing for some time with thinking about Lisps in a Tcl-style way (not too far off since Tcl was partially inspired by Lisp) and working on a compiler for same.

                      • Commands/functions are first item
                      • Arguments follow
                      • Inline substitution is wrapped by square brackets (print [reverse "olleh"])
                      • Infix math is allowed by expr macro with operator precedence

                      Compare:

                      proc square [n] {
                        expr (n * n)
                      }
                      

                      To:

                      (proc square (n) (expr (n * n)))

                      Or:

                      (proc square (n) (* n n))

                      Or:

                      (def square (fn (n) (* n n)))

                      Same thing, just start & end with parenthesis, use line breaks and spaces, and think about all square brackets or curly braces as parentheses as well.

                      Works for let-style scoped blocks. Here I call it with, and def is called set like in Tcl.

                      >>> set a 42
                      42
                      >>> with { a 7 b 2 } {
                      ...   square [expr (a * b)]
                      ... }
                      196
                      >>> a
                      42
                      

                      I’d like to continue developing this as I like the conceptual elegance of Lisp and it feels very easy to learn and to read.

                      1. 2

                        This is a good direction. I’m always stoked when people try someone genuinely new.