I can totally empathize with someone that has the not-unreasonable mental model of .field_name
as "field syntax" seeing this proposal as a strange inconsistency - after all, with that model, the only way to make sense of .await
is as a magic field accessor, a one-off property getter with strange control flow.
But from what you know of the lang team, are they really the type to pick an ad-hoc solution just for the sake of being weird, or just to shoehorn in a feature? Everything I've seen from them suggests the complete opposite. The Rust way is to take a deeper look at the problem and solution space and come up with an innovative approach that is better than what's been done before.
In this case, the real underlying issue is that sometimes one prefers keywords in prefix position, and sometimes one prefers them in postfix position. If you have to pick only one variant forever, you end up penalizing the programming style that isn't favored. Also, there isn't much to go on as far as how to implement postfix keywords in any existing language.
The insight that was hinted at in the final proposal (and has been brought up a few times in related discussions over the last few weeks) is that the solution may be to loosen the restrictions on the .
operator that we've inherited from other languages. Currently, keywords and macros aren't allowed as .
operands, but in most cases it's pretty clear how they would behave if they were.
This requires changing one's mental model. One way is to add a new rule: .await
is a special case. A different way is to start thinking of the .
operator as a the "chain" operator and remembering what isn't allowed to be chained.
Yes, this adds to Rust's "wierdness budget", but this is doing it for the right reason: discovering a way to solve a problem that many programming languages have, but few have really tackled.