Await Syntax Discussion Summary

If you want to see how some of the proposed await syntaxes would look like in the context of a more substantial piece of code, check out the await-syntax repo. It (presently) contains the source of a rather async-heavy utility from Google’s Fuchsia, translated to several syntaxes from the lang team’s writeup (two prefix and two postfix).

While adapting the code, I’ve noticed that a) as expected, a lot of await calls interact with ?, b) there were not really many opportunites to chain awaits (four out of forty-something calls, no more than two awaits in a chain).

Personally, because of b) above, I didn’t find the prefix syntaxes more awkward, but the one with mandatory delimiters felt more regular, as await? doesn’t have a great solution for . precedence. I must admit that the postfix field syntax flowed rather nicely, and the inconsistency with real field access didn’t bother me at all if I thought about .await as “dot-await operator” instead of “accessing the await field”.

12 Likes