Some languages, such as JS and Rust, make a distinction between normal/synchronous functions and async ones. An async function is typically syntax sugar for one which returns a future/promise, which like the name implies, will (theoretically) have a value at some point in the future. In order to get a value from this promise without using a callback function, one can await it. An await can only be used in an async function, and it will "block" (typically allowing other things to run in the thread) until the promise returns.
Both JS and Rust use an async keyword in front of the function keyword to make a function asynchronous. While JS uses a prefix await operator, Rust uses a postfix .await which looks like a property access. I've seen complains about both syntaxes, many of which I agree with.
What are some different options for async/await syntax, and what are their pros and cons?
await, but I’m curious aboutasyncas well — JSasync function foo()vs Swiftfunc foo() async, for example. $\endgroup$asyncbefore, it's worth making that an answer I think $\endgroup$