Rhombus Language
16 comments
·March 18, 2025rednafi
The syntax looks clean, akin to Python, but with terser record types. This would make a nice config or an embedded language like Lua.
One thing I’d appreciate here is a “Why Rhombus?” page, even if the rationale is simply that it’s fun.
Edit: Turns out there’s a goals[1] page. Rhombus is trying to replace Lisp’s parenthesis-heavy syntax with something cleaner while keeping Racket’s powerful macro support.
Jtsummers
> Why a new language? See Rhombus Goals.
Rhombus Goals links to: https://rhombus-lang.org/goal.html
rednafi
Graaah, totally missed it. Thanks!
hudon
here is the "goal" page: https://rhombus-lang.org/goal.html (with related paper & talk)
rednafi
Thanks. It’s nice to see at least a few in the FP community recognize that Lisp dialects, with their parenthesis-ridden S-expressions, are hard to read and write.
MathMonkeyMan
I'd say it's more like "we've been teaching Scheme for decades, and we just have to admit that most people don't like S-expressions."
wavemode
From the 2nd example:
class Rect(left, top, right, bottom)
fun rect_like_to_rect(v): match v | Rect(_, _, _, _): v | {"LT": [l, t], "RB": [r, b]}: Rect(l, t, r, b) | {"TL": [t, l], "RB": [b, r]}: Rect(l, t, r, b)
rect_like_to_rect({"TL": [0, 2], "RB": [10, 5]}) // ⇒ Rect(0, 2, 10, 5)
Isn't this wrong? I'd expect to see Rect(2, 0, 5, 10) instead.
It also seems like "RB" was meant to be "BR".
gus_massa
I guess it's a typo and the second line should say "BR". I just send a PR to fix it.
coolio1232
This actually looks good. It's like a less-obtuse Haskell. At a glance the features seem to be just the right mix of functional programming paradigms and standard imperative programming.
steve_adams_86
The other day I saw someone describe writing Haskell as “programming with your elbows while listening to math rock”, which is awesome. I can see the need for a less-obtuse Haskell
bmitc
Less obtuse Haskells have existed for years: Standard ML, OCaml, and F#.
bmitc
What is the relation to Haskell?
The language is basically Racket, which is a Scheme at its core. There's very little in common with a language like Haskell.
fithisux
Is this a reincarnation of Pyret?
null
This is racket's [rhombus], which might be an interesting second link here; it's a scheme, underneath, with the full power of Racket libs available.
[`shrubbery`], the replacement for s-exprs, is pretty interesting, expanding s-expr simply with grouping, and then a separate infix-pass on top. I've been playing with using it as the basis for a separate language; it's in an interesting place in the AST space, especially given the forethought put into macros.
[rhombus]: https://docs.racket-lang.org/rhombus/index.html
[shrubbery]: https://docs.racket-lang.org/shrubbery/index.html