Hacker News new | ask | show | jobs
by TwentyPosts 683 days ago
I feel like a link to a 'pitch' or description of the Rhombus language would've been more insightful for most of us. Even being familiar with Racket, I don't know what Rhombus is.
3 comments

Agreed.

Here's the link I found more informative:

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

I didn't. Still not a single explanation of what the language is / what its designers are trying to do.
The OOPSLA paper is more interesting: https://dl.acm.org/doi/pdf/10.1145/3622818

Abstract: Rhombus is a new language that is built on Racket. It offers the same kind of language extensibility as Racket itself, but using conventional (infix) notation. Although Rhombus is far from the first language to support Lisp-style macros without Lisp-style parentheses, Rhombus offers a novel synthesis of macro technology that is practical and expressive. A key element is the use of multiple binding spaces for context-specific sublanguages. For example, expressions and pattern-matching forms can use the same operators with different meanings and without creating conflicts. Context-sensitive bindings, in turn, facilitate a language design that reduces the notational distance between the core language and macro facilities. For example, repetitions can be defined and used in binding and expression contexts generally, which enables a smoother transition from programming to metaprogramming. Finally, since handling static information (such as types) is also a necessary part of growing macros beyond Lisp, Rhombus includes support in its expansion protocol for communicating static information among bindings and expressions. The Rhombus implementation demonstrates that all of these pieces can work together in a coherent and user-friendly language.

Also not sure. I'm guessing it's some kind of Lisp bracketectomy - i.e. Lisp without the parentheses.
Yes. It's a bracketectomy on Racket that's designed to (unlike previous bracketectomies) retain all the metaprogramming goodness of Lisp.
Parens-less(er) Lisp, whitespace/indentation-based s-expressions.
Looks like "yet another Lisp without s-exprs for babby ducks". I'd probably go the Julia route if this is what I wanted, personally.
You are being down-voted for the snark, but there is point there. This seems to be "people use Python because of the whitespace, so let's remove parenthesis." Which if true, is (1) vastly missing the point, and (2) this project isn't really exploring any fundamentally new areas of language design then.

I was kinda hoping to see this was the next generation of Lisp language design, but it appears to be just a different syntax.

> I was kinda hoping to see this was the next generation of Lisp language design, but it appears to be just a different syntax.

Dig deeper in the reference documentation.

It does things Lisp doesn't do?
Is that the "Racket 2" thing they wanted to make some time ago?
Yes
The pitch, compared to Racket, is conventional yet still extensible syntax.
I'll have to read about why they made the choices they made, but it reminds me of going to a microbrewery: You tell them you like simple (American) macrobrews, and they say they have just the thing. What arrives is a light lager that tastes awful because they think macrobrews beers are awful. So they made an awful beer that doesn't taste like a macrobrew.

I don't think Rhombus is going to appeal to people that are comfortable with Python, C, Java, Go, JavaScript, etc... It's got infix, but it's cryptic. It seems like a step back from StandardML or Ocaml.

Maybe there's a justification in terms of how the macros work. Maybe they're poisoning the well to make Lisp syntax more appealing. I'll try to reserve judgment, but so far I'd rather program in Scheme/Racket than this.

I don't think the Racket/Rhombus developers are really trying for adoption. They're trying to push the field forward via their research. Creating these useful programming languages is how they validate their research, but the end goal is not to grab a large share of working developers but to grab mindshare of the few developers who create the future of programming. In this they have been quite successful.
I agree they probably aren't going for world domination, but here is a nice video from Mathew Flatt where he says, "The point of Rhombus is to make Racket macro technology more accessible" and "removing an obstacle for most people":

https://youtu.be/OLgEL4esYU0

Having traditional infix operators, function calls, array subscript, and field access is a great start, but after that it doesn't look very traditional or familiar at all.

I hope they succeed, and I'll keep following their progress, but when I look at their if-statements, it's pretty non-traditional:

    if is_rotten(apple)
    | get_another()
    | take_bite()
      be_happy()
It looks like it has indentation-based grouping with vertical bars, white space, and colons implying different precedence, and that makes me have a lot more questions. I think my American macrobrew analogy above holds.

https://docs.racket-lang.org/rhombus/Notation.html

(I'm not very involved with the Rhombus project. I just post there a comment from time to time.)

I think that the macro system can handle the traditional "if X ... else ..." structure, but there is a design decision to avoid magic keywords like "else" as much as possible, like "in" in "fox X in Y: ..." Why should each construction have a different magic keyword? Can it be solved with only one thing that is shared in all construction like "|"? If you see the examples, all the other constructions with branches like "cond" that replaces "if" with "elseif" or "elif" ir whatever use "|". "match" also uses "|". This is better if you want to write macros that extend the language and have a similar structure.

(For what it's worth, I insisted in that "if" uses two "|" (one for each branch, instead of one only for the "else" part.)

> one for each branch, instead of one only for the "else" part

aut consequens, aut alternatus? ( https://en.wiktionary.org/wiki/aut#Conjunction )

Yeah, the if statements are definitely a little weird-looking to me. It seems like the goal is to allow for more traditional infix syntax while still defining most of the language using the macro system; it seems unfortunate if their macro system can't handle more traditional-looking "if (x} block; else block" conditional statements.
As someone who gets the shakes from looking at too many parenthesis I think it's a great step in the right direction.

A few weeks ago I went through the "GUI demo" source, and it's not bad. Of course just reading it doesn't tell much about what's the IDE support, how easy it is to figure out the arguments/types. (But it's rhombus/static, which is encouraging!)

https://github.com/racket/rhombus/blob/master/gui_demo.rhm

a.k.a. Python-like with macros
It would also help to have such a description in the README