Every time I see another poll about the @rustlang async/await syntax, I feel like it's missing the option "I just want async/await to be stable and will defer to the Rust Core team's best judgment about the syntax"
-
Show this thread
-
mik Retweeted mik
I don't currently do any Rust programming, but thread FWIW: https://twitter.com/mik235/status/1129246179835883520 … (async/await is a mistake)
mik added,
2 replies 0 retweets 2 likes -
Promises/async/await seem like a total hack necessary for JavaScript only. Why would languages that don’t need (Rust, C++) it adopt it? What am I missing? It’s miserable in JS, too.
4 replies 0 retweets 5 likes -
Because it’s the fastest of all available options. Coroutines needs stacks and are therefore slower.
4 replies 0 retweets 6 likes -
Ok, this plagued me all night... how do you do async/await without allocating more stacks?
1 reply 0 retweets 0 likes -
Can’t give you a super in depth answer right now, but async/await compiles to a generator, and you give that generator one, single, exactly sized stack.
1 reply 0 retweets 0 likes -
All async functions in your code compile into one generator?
1 reply 0 retweets 0 likes
Each chain of them. Like, calling one returns a future, that’s a generator for every async/await in the call stack of that one. But you can make more than one, if you want/need
-
-
It would almost be nice to spawn a thread for each of those chains.
1 reply 0 retweets 0 likes -
Some executors, like tokio, have a threadpool behind it, yep :)
1 reply 0 retweets 0 likes - 1 more reply
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.