Update on await syntax in Rust
A bit off-topic: Is there any theoretical reason you <i>need</i> async &#x2F; await syntax at all?<p>(It&#x27;s certainly desirable for performance and compatibility to avoid making all subroutines into coroutines, so I understand why most languages have done this.)<p>And restricting it to the case where coroutines have a single return...<p>Subroutines are naturally coroutines that don&#x27;t yield. And it seems like the question of whether it&#x27;s a subroutine or a coroutine shouldn&#x27;t be something the programmer needs to worry about.<p>What I&#x27;ve seen in coroutine libraries is the main reason we <i>need</i> await seems to be for cases when we don&#x27;t want to await a result.<p>If you need an unawaited invocation to pass to a routine like gather, you do this:<p><pre><code>    my_results = await gather(run_job(x) for x in work)
</code></pre>
But, even if we can&#x27;t infer from the type of gather that it must accept a future, a function can have a method that asks it to return a future:<p><pre><code>    my_results = gather(run_job.future(x) for x in work)
</code></pre>
You&#x27;d often want to dispense with gather. If I have these statements:<p><pre><code>    alpha = run_alpha()
    beta = run_beta()
    gamma = run_gamma()
    return alpha + beta + gamma
</code></pre>
In most cases, e.g. if these were requests going over the network, we&#x27;d prefer to schedule all three at once. If we want to sequence side-effects, then explicit await makes sense:<p><pre><code>    alpha = run_alpha.await()
    beta = run_beta.await()
    gamma = run_gamma.await()
    return alpha + beta + gamma
</code></pre>
That makes the most concurrent option easiest, as opposed to the clunky idiom of &quot;gathering&quot; many results.