A final proposal for await syntax

It seems to me that a lot of the important variables that dictate what is the best syntax are presently undecided.

For example:

  • There has been some discussion of using @ sigil as a more generalized form of chaining. - If this were implemented it would make that approach much more appealing.
  • Similarly there is an open RFC for Postfix macros. If that were to land it would make that style much more appealing.
  • There has been discussion above of allowing other keywords such a ‘match’, ‘for’ and ‘return’ to also be suffixed following a dot. If that existed the field style syntax is more appealing.

Finally and most importantly, there is the open question of what it looks like in a for loop. We are all still waiting with baited breath for @withoutboats second blog entry on the subject. If ‘await’ becomes part of the loop structure and not the pattern the the simple keyword prefix is more appealing. Where as if it can be made part of the pattern, and can be generalized to things like ‘match’ then any of the Postfix options are more attractive.

There is a large divergence between where the Lang team ended up and what a poll of readers of this form preferred. Perhaps this is a result of an asymetriry in information on the likelihood of these features happening.

Can @nikomatsakis or anyone from the Lang team give some insight into what the current perceived odds of each of these happening are? As they would definitely impact what makes a good choice here. (And conversely this decision could end up influencing which of these other ideas get attention and worked on).

3 Likes