Await a minute, why bother?
A great discussion of what Rust's async syntax enables over futures, particularly with conditionals and borrowing.
miniblog.
Related Posts
rust-analyzer has a really cute feature "highlight related". It will highlight the enclosing loop when cursor is on `break`, or the enclosing `async` when cursor is on `await`:
Suffix syntax (e.g. foo.field or result_bar?) tend to provide a better IDE experience. Languages deliberately tailor features for this, e.g. Rust has .await.
Is this a historical accident? I can certainly see how parsing unfinished suffix syntax is easier.
Rust's model of async-await is really interesting. They chose a suffix syntax (`foo.await` instead of `await foo`) because it composes better!
The evaluation model is also lazy: creating a future does nothing until it's awaited.