State of Rhombus (programming language)
github.com
github.com
As an aside, I'm working on a different new programming language that supports language-level programming through a macro/effect system (and doesn't use s-expressions). In practice, Macro systems work well on any language that has the concept of 'forms' (see: Homoiconicity isn’t the point)
> Another disadvantage of S-expressions is that many of the parentheses are redundant after the expression is pretty-printed, because indentation provides the same grouping information in a more human-readable way.
The parentheses are not redundant at all! They are useful markers for selecting, cutting, pasting source code. I have mentioned this on the mailing list before, when there was discussion about moving away from S-expressions.
I get it, they want to keep an open mind and research other syntax. That's fine and good! But don't act, as if the parentheses are redundant and of no use. Find something better that supports the same level of code editing ease, then come back and present. I think it might even be impossible to do that, because you will still need those start and end markers, whatever they look like, or build the tooling, that has so deep understanding of the language's syntax, that it can "read your mind" and select the correct parts.
I will keep an open mind for when they surprise me and come around with something, that checks all the boxes.
I think for this effort to succeed, they only need to do as well with editor support as other mainstream languages.
I often see people using VS Code editing code. To me it often looks painful and I have the urge to do the code editing myself in Emacs with all my key bindings and good S-expression support. I have seen people being even much faster than me as well, with extra commands they define for moving S-expressions around and paredit and so on. Maybe VS Code can somehow be configured to offer the same comfort in code editing. I have not seen it done so far.
I think this is another move in that direction. If it fails, then we will have a strong data point into why Lisps are just better for some things. But the team is dedicated to not just doing things the old way and we've gotten so much good from that mode of thinking that I'm excited to follow this process whether it fails or not.
The syntax here looks isomorphic to sexpr. If so, one could program by reading the | based form, then convert the whole file to sexpr to edit it, then pretty print back to indent form when done. Better if the parens only replace the | and whitespace on the conversion so the cursor doesn't jump.
I'm not sure I like that but it is a somewhat interesting design point.
Also, pretty much any language that parses to an AST could easily output same as s-expressions if desired. Which incidentally is something I enjoy so much about Lisp. It makes it trivial to reason about code as a tree of structured objects instead of a string.
->
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/ .
[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.
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.
That’s true with Lisp as well. The point of homoiconicity is that your DSL looks like your parent language.
That said, Julia supports string macros. See for example “APL.jl” for a macro of to compile APL to Julia.