Rendered at 06:23:04 GMT+0000 (Coordinated Universal Time) with Cloudflare Workers.
ashton314 4 hours ago [-]
I’ve written a little library Rhombus.
I think my favorite thing is the `…` operator. Go check it out. It’s not like the splat operator in other languages, though it does give that feel initially. It’s much more general: it works with nested data structures and can take the place of a `map` operation.
The best part of `…` is that it is not a built-in thing—it’s just a macro! The magic is that Rhombus lets you define different macros depending on whether or not the macro identifier appears in binding context (left side of `=`), expression context, or some other contexts. IIRC you can even define your own contexts too.
Rhombus takes the best-in-class macro system of Racket and somehow finds a way to improve upon it. I say this after researching and comparing detailed metaprogramming features across a dozen different languages. Rhombus is a very neat little language.
Last thing: Rhombus’ main data type, the list, is implemented with an RRB tree. RRB trees support structural sharing, functional updates, and have O(log n) iterate, insert, delete, append, and arbitrary read operations. The constant factor on that is tiny: I think it’s like log_16 or log_32. They’re designed to be very cache friendly. Super cool data structure.
bjoli 43 minutes ago [-]
Finally someone uses the rrb tree as their main data structure! I implemented it for c# and the performance tradeoff compared to List<> was smaller than i had thought.
Lots and lots of documentation, some experimentation, and asking people. :)
gus_massa 5 hours ago [-]
I was not very involved in this. I still prefer s-expressions.
Anyway, my main initial concern was how to make good macros without s-expressions. There is a nice video by Matthew Flatt in RacketCon 2023. The first 6 minutes and 20 seconds are internal stuff, so skip to the 380s that I added in this link: https://www.youtube.com/watch?v=OLgEL4esYU0&t=380s He takes like another 6 minutes to explain the general idea and make some wishes, and then at the 12m mark he defines macros in Rhombus and makes the wish real in just 2m (with some enhancements later).
azhenley 3 hours ago [-]
You can read about Shrubbery, just adding the Rhombus syntax in Racket:
What with the term itself, is that some monthy python reference or related to tree algebraic structure?
ashton314 2 hours ago [-]
Matthew Flatt picked “shrubbery” because it’s tree-like but not fully expanded, so it tends to be more broad/flat than deep like a tree. Hence also the term “enforrestation” when you fully expanded it.
I think the Monty Python reference is just a happy coincidence.
psychoslave 2 hours ago [-]
Nice to get so much insightful feedbacks. That's the kind of exchange that make HN still sometime interesting.
brightball 4 hours ago [-]
I'd love to get a talk on this at the 2027 Carolina Code Conference (polyglot and cybersecurity). Call for Speakers will open in January.
* approachable and easy to use for everyday purposes, with a readable indentation syntax; and
* uniquely customisable with an _open-compiler API_ that is accessible to a wide audience.
cptmurphy 24 hours ago [-]
Racket is already approachable and easy to use for everyday purposes
bjoli 20 hours ago [-]
A lot of people hate sexprs. Even seemingly reasonable folks.
I imagined they have met students that really struggle with the syntax, while grokking the concepts easily.
I myself have heard "the parentheses are hard to balance" and "after a while you dont even see the parentheses" enough times that I think maybe both can be correct.
iLemming 3 hours ago [-]
> A lot of people hate sexprs
In all my time I have never come across a single Lisper, neither in person nor online, and I know far more than a few dozens, who once grokked the REPL-driven workflow and the structural editing idioms only to later, for whatever reason, suddenly start disliking or even hating s-expressions.
All that so-called "hatred" stems from unfamiliarity. People fuss about Lisps lacking static types, without a single clue about how a "true" REPL trades them off for something different. They compare it to a Python or C# REPL and think "it ain't a big deal". Well, the Lisp REPL is quite different, and yes, a major deal - every single part of the Read-Eval-Print-Loop differs. They complain about "hard to deal with parentheses" and "I can't refactor without types" while having no clue how amazingly nice structural editing is in practice, that you never even think about parens - you only see structure, order and reason.
lmm 20 minutes ago [-]
> In all my time I have never come across a single Lisper, neither in person nor online, and I know far more than a few dozens, who once grokked the REPL-driven workflow and the structural editing idioms only to later, for whatever reason, suddenly start disliking or even hating s-expressions.
And we've never seen bullet holes in these parts of the plane, so there's no point putting armour there.
bjoli 27 minutes ago [-]
As I said, i think they have been teaching long enough to have a pretty good basis for the claim that racket's syntax can be a problem.
I am firmly in the "after a while you don't see the parentheses" camp, but I have a friend who I respect a lot who works in clojure (with Emacs/cider/paredit) that just doesn't like it.
I mean, I prefer sexprs above all other syntaxes, and I have had people tell me I just need to get used to indentation syntax or whatever they fancy.
jitl 2 hours ago [-]
well, i guess i know what the grandparent was talking about when they said 'I myself have heard [...] "after a while you dont even see the parentheses" enough times [...]'. Thanks for the example.
drob518 4 hours ago [-]
My editor balances my parentheses (Emacs Paredit). I rarely think about them. I just think structurally and the editor manages the details.
psychoslave 2 hours ago [-]
It really feels like, "when I move through the wasteland, I only focus on the path and GPS is guiding me well".
For some reasons, people tend to prefer having a walk in a forest rather than in z wasteland.
jitl 2 hours ago [-]
For you, perhaps. I've never been able to get into lisp style sexpr syntax languages :'(
ashton314 2 hours ago [-]
)
There matched your paren for you.
ginko 6 hours ago [-]
Adding significant whitespace to a new language feels like a bad choice. It's not terrible but I do think it was a bad call for Python in hindsight.
cmoski 2 hours ago [-]
Massive fail. I dread having to move code around my F# codebase.
pasquinelli 6 hours ago [-]
why do you think it was a bad choice?
ginko 6 hours ago [-]
It‘s a source of problems with mismatched tabs/spaces being used for indentation between team members for fairly little upside.
Imo it also makes moving blocks of code more cumbersome.
miffi 2 hours ago [-]
Shrubbery, Rhombus's first-pass indentation-sensitive syntax, has a syntax form to facilitate copy-paste.
With guillemets, « and », you can make a section of Shrubbery code indentation-insensitive. The idea for copy-paste it to "armor" the section you want to copy with guillemets in the right places, and unarmoring it after posting.
This needs editor support to do fluidly, but imo it's much better than trying to copy-paste the indentation-sensitive syntax.
I can't tell from my 5 minutes of poking DrRacket whether it supports this "armoring", I've been writing Shrubbery in nvim, which, unsurprisingly, does not support it.
monkamonme 2 hours ago [-]
[flagged]
dartharva 3 hours ago [-]
I wonder how much utility of such special-purpose languages will keep getting diminished as AI coding becomes a staple in programming and software engineering.
psychoslave 2 hours ago [-]
With current LLM I am not sure. Using macro, you can often spare a lot of explicit code boilerplate. So token efficiency. On the other hand, will LLM shine in such a paradigme, where picking the right abstraction is more useful than generating large amount of lines?
Maybe it's a lake of training set, but just roaming the fine article, it already mention a LLM generated project which is more looking like Java idiomatic rather than something authors would consider elegant Rhombus code.
I think my favorite thing is the `…` operator. Go check it out. It’s not like the splat operator in other languages, though it does give that feel initially. It’s much more general: it works with nested data structures and can take the place of a `map` operation.
The best part of `…` is that it is not a built-in thing—it’s just a macro! The magic is that Rhombus lets you define different macros depending on whether or not the macro identifier appears in binding context (left side of `=`), expression context, or some other contexts. IIRC you can even define your own contexts too.
Rhombus takes the best-in-class macro system of Racket and somehow finds a way to improve upon it. I say this after researching and comparing detailed metaprogramming features across a dozen different languages. Rhombus is a very neat little language.
Last thing: Rhombus’ main data type, the list, is implemented with an RRB tree. RRB trees support structural sharing, functional updates, and have O(log n) iterate, insert, delete, append, and arbitrary read operations. The constant factor on that is tiny: I think it’s like log_16 or log_32. They’re designed to be very cache friendly. Super cool data structure.
https://github.com/bjoli/RrbList/tree/main/src/Collections
I’m very interested in this. What was your research approach? Are there resources you can recommend beyond the documentation for individual languages?
Lots and lots of documentation, some experimentation, and asking people. :)
Anyway, my main initial concern was how to make good macros without s-expressions. There is a nice video by Matthew Flatt in RacketCon 2023. The first 6 minutes and 20 seconds are internal stuff, so skip to the 380s that I added in this link: https://www.youtube.com/watch?v=OLgEL4esYU0&t=380s He takes like another 6 minutes to explain the general idea and make some wishes, and then at the 12m mark he defines macros in Rhombus and makes the wish real in just 2m (with some enhancements later).
https://docs.racket-lang.org/shrubbery/index.html
I think the Monty Python reference is just a happy coincidence.
https://carolina.codes
Summer Rhombus picture competition 2026 - https://news.ycombinator.com/item?id=48546270 - June 2026 (2 comments)
Rhombus Language - https://news.ycombinator.com/item?id=43394881 - March 2025 (158 comments)
Rhombus: Macro-extensible language with conventional syntax built on Racket - https://news.ycombinator.com/item?id=41151439 - Aug 2024 (97 comments)
State of Rhombus (programming language) - https://news.ycombinator.com/item?id=30314109 - Feb 2022 (17 comments)
* approachable and easy to use for everyday purposes, with a readable indentation syntax; and
* uniquely customisable with an _open-compiler API_ that is accessible to a wide audience.
I imagined they have met students that really struggle with the syntax, while grokking the concepts easily.
I myself have heard "the parentheses are hard to balance" and "after a while you dont even see the parentheses" enough times that I think maybe both can be correct.
In all my time I have never come across a single Lisper, neither in person nor online, and I know far more than a few dozens, who once grokked the REPL-driven workflow and the structural editing idioms only to later, for whatever reason, suddenly start disliking or even hating s-expressions.
All that so-called "hatred" stems from unfamiliarity. People fuss about Lisps lacking static types, without a single clue about how a "true" REPL trades them off for something different. They compare it to a Python or C# REPL and think "it ain't a big deal". Well, the Lisp REPL is quite different, and yes, a major deal - every single part of the Read-Eval-Print-Loop differs. They complain about "hard to deal with parentheses" and "I can't refactor without types" while having no clue how amazingly nice structural editing is in practice, that you never even think about parens - you only see structure, order and reason.
And we've never seen bullet holes in these parts of the plane, so there's no point putting armour there.
I am firmly in the "after a while you don't see the parentheses" camp, but I have a friend who I respect a lot who works in clojure (with Emacs/cider/paredit) that just doesn't like it.
I mean, I prefer sexprs above all other syntaxes, and I have had people tell me I just need to get used to indentation syntax or whatever they fancy.
For some reasons, people tend to prefer having a walk in a forest rather than in z wasteland.
There matched your paren for you.
With guillemets, « and », you can make a section of Shrubbery code indentation-insensitive. The idea for copy-paste it to "armor" the section you want to copy with guillemets in the right places, and unarmoring it after posting.
This needs editor support to do fluidly, but imo it's much better than trying to copy-paste the indentation-sensitive syntax.
The Guillemets syntax is described here: <https://docs.racket-lang.org/shrubbery/group-and-block.html#...>
I can't tell from my 5 minutes of poking DrRacket whether it supports this "armoring", I've been writing Shrubbery in nvim, which, unsurprisingly, does not support it.
Maybe it's a lake of training set, but just roaming the fine article, it already mention a LLM generated project which is more looking like Java idiomatic rather than something authors would consider elegant Rhombus code.