2 ms·
Is this so central, that it justifies the use of a single ascii char? Instead of, say, `Never`?
by salsa_catsup 20d ago
Is this so central, that it justifies the use of a single ascii char? Instead of, say, `Never`?
- db48x 20d agoI can see that you’ve never designed a language. The design and implementation of Rust took many years. Over that time people’s ideas and priorities changed. Even the people changed. In the early days of the language design sigils were very heavily used throughout the language. Even the language keywords were deliberately shortened as much as possible (consider ”fn“ and ”ret“, for example). Most of the sigils were eventually replaced with traits, but not all of them. ”!“ is one that survived.
- deleted 20d ago[deleted]
- simonask 20d agoIt's not really like there's a budget for it, and "!" is already a type people have seen in the return position of extremely common macros (panic!, todo!, etc.), functions (std::process::exit, etc.), and expressions (return, break, continue). The question is more whether it's unambiguous (it is), and whether there's something else you would rather use it for (there isn't).
- pie_flavor 20d agoIt has been in the language for fourteen years. What would be the purpose of changing it? And what else would ! in the type position signify?
- ddosmax556 20d agoIt results in different behavior in the compiler. You don't have to check the return type of a function in which you call a function return never. Using a different symbol gives you a hint why the code works, if you used `Never` you'd have to KNOW it works differently.