Pre-RFC core::ops traits for relational operators

The problem with syntax extensions that add new lexemes is that, in most cases, they complicate the language for all Rustaceans while providing little benefit. My initial foray into Rust was along this line, looking at adding lexemes for wrapping arithmetic operators for use with crypto code. But then I examined potential usage statistics within the compiler and the existing crypto code base on crates.io, and found that the new lexemes would replace at most 5% of the uses of the similar non-wrapping Rust operators.

For me the big issue with all such syntax-extension proposals is their justification: How much harder does the proposal make it to learn and use Rust for the average user, vs. how much benefit does it provide in actual code use? IMO the postfix try operator ? earns its weight. How many other proposed lexemes will be used frequently enough to justify the learning and parsing/recognition complexity that they impose on all Rust programmers?

3 Likes