Rhombus Language 1.0

(blog.racket-lang.org)

91 points | by Decabytes 1 day ago

7 comments

  • ashton314 1 hour 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.

    • WalterGR 1 hour ago
      > I say this after researching and comparing detailed metaprogramming features across a dozen different languages.

      I’m very interested in this. What was your research approach? Are there resources you can recommend beyond the documentation for individual languages?

  • azhenley 36 minutes ago
    You can read about Shrubbery, just adding the Rhombus syntax in Racket:

    https://docs.racket-lang.org/shrubbery/index.html

  • gus_massa 2 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).

  • brightball 45 minutes 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.

    https://carolina.codes

  • dang 3 hours ago
    Related. Others?

    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)

  • spdegabrielle 1 day ago
    Rhombus is designed to be

    * 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 21 hours ago
      Racket is already approachable and easy to use for everyday purposes
      • bjoli 17 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.

        • drob518 54 minutes ago
          My editor balances my parentheses (Emacs Paredit). I rarely think about them. I just think structurally and the editor manages the details.
    • ginko 3 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.
      • pasquinelli 3 hours ago
        why do you think it was a bad choice?
        • ginko 3 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.
  • dartharva 30 minutes 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.