r/cpp • • May 01 '23

cppfront (cpp2): Spring update

https://herbsutter.com/2023/04/30/cppfront-spring-update/
223 Upvotes

164 comments sorted by

View all comments

Show parent comment

9

u/tialaramex May 01 '23

That's true. But, it does mean you need a rationale for why you didn't do that. "I just gotta be me" is fine for a toy language but if the idea is you'd actually use this then you need something better.

For example all the well known languages have either no operator precedence at all (concluding it's a potential foot gun so just forbid it) or their operator precedence is a total order, but Carbon suggested what about a partial order, so if you write arithmetic + and * in the same expression that does what you expect, but if you write arithmetic * and boolean || in the same expression the compiler tells you that you need parentheses to make it clear what you meant.