Comment by rtpg

3 days ago

I am once again calling for someone to make something that's "basically clojure" but with whitespace instead of parens.

Parens don't matter, but giving values names causing indentation is something I simply cannot abide as a terminal intermediary value name giving person.

EDIT: oh and also something with "proper" multiline comments. Thanks!

I'm interested in exploring this as a potential dialect of jank. In the simplest approach, it's just a lexer change. However, there are implications around how macros will work, since macros generate s-expressions in Clojure, but they'd need to generate whitespace blocks if we want the homoiconicity to spread throughout.

If you're interested in funding this work, or helping with the designs, please reach out. In the meantime, make sure you check out Rhombus. https://rhombus-lang.org/

  • Right, it's hard to disconnect some of Clojure's niceties from the macro work (though I think Clojure's macros tend to do less inner inspection than macros you'll see in other lisp variants)

    The link to Rhombus is very interested, I hadn't heard of this and it looks very well developed. Will mess around with it.

Are you sure you want that? It's possible to use whitespace and conventions to denote s-expr. For example, have each line implicitly start with a ( and use \n for ). More complicated schemes involving counting indentation also available. Anything you like that parses to a tree really.

The price will tend to be that working out what the code parses to gets much more difficult for the programmer. The parser won't care. Guessing what the programmer might have meant for error messages gets harder. Copying code around in a file will tend to change the meaning.

Worth noting that dear python, whitespace enthusiast, still has spurious : scattered around to give slightly better behaviour on syntactically invalid input, and they managed to compromise the semantics of lambda to keep the whitespace magic working.

An alternative you might like is colouring parens light grey (or dark, whatever mostly matches the editor background) and have the editor insert them for you.

This comes up all the time. I used to dismiss lisps and schemes as well because of parens until I've messed with Racket. My advice to you is to stop worrying and embrace parens. The REPL helps.

  • As an emacs user I'm often writing small snippets of elisp for my own needs, and for snippets it's fine. But I dislike what most lisp's scoping strategies do to "normal" indentation of code. Any function with even a single intermediate value, indented due to a `let`! It's noticably more symbols compared to my Python stuff.

    On top of that, being unable to just slap in big docstrings in my code makes me sad. Docstrings are useful.

    This isn't the end of the world, but it's something that bugs me.