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