x^2 means x squared, orphaning the XOR operator. Rune is for crypto, so math comes first.
Isn't XOR used very heavily in crypto? (As is exponentiation of course) x^2 means x squared, orphaning the XOR operator. Rune is for crypto, so math comes first.
Isn't XOR used very heavily in crypto? (As is exponentiation of course)https://github.com/google/rune/blob/main/bootstrap/database/...
That innovation does seem like a potential footgun.
Unicode, OTOH, doesn’t have this problem.
Rationale: in normal usage, short-circuiting logical operators are, in effect, a special kind of control flow statement, and control flow statements are typically spelled out. Bitwise operators are more unequivocally meant for calculation, and therefore perhaps more deserving of similar syntax to the arithmetic operators, despite their less frequent usage.
I think that this way of drawing the distinction might be particularly relevant in a language that disallows conditional branching - and, by extension, short-circuiting logical operations - on certain kinds of data the way Rune does.
With a strong type system, it knows if the input is bool or integer
It would've been wiser to duplicate C's bit operators ( ~ ^ & | << >> ) than give the emperor some "new clothes."
Welcome to another "Not Invented Here" language dying to be special and full of surprises. It's a fail.
But hey, if Google says math comes first...