Hacker News new | ask | show | jobs
by xscott 683 days ago
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

2 comments

(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.