Async and Await in Rust: a full proposal
This is exciting. It allows programmers to model their problems in code that fully accounts for the parallelism.<p>For comparison, here is async&#x2F;await in Zig: <a href="https:&#x2F;&#x2F;ziglang.org&#x2F;documentation&#x2F;master&#x2F;#Coroutines" rel="nofollow">https:&#x2F;&#x2F;ziglang.org&#x2F;documentation&#x2F;master&#x2F;#Coroutines</a><p>Zig decided to go the other way - when you async call a function, it <i>does</i> eagerly evaluate until the first suspend point. This is less overhead than immediately suspending, plus it removes the dependency of the language feature on a userland event loop. Users who want the immediate suspend feature can call a userland utility method of the event loop which suspends and then tail calls the async function in question.