3 ms·
1. I am not sure exactly how async/await is implemented, but I believe it is very similar. Some people are also working on implementing similar sugar in Rust, b
by steveklabnik 10y ago
1. I am not sure exactly how async/await is implemented, but I believe it is very similar. Some people are also working on implementing similar sugar in Rust, but it's not done yet.
2. Closures are on the stack, not the heap, by default, in Rust. If you don't see a Box, they're not heap allocated.
3. I agree!
- moosingin3space 10y agoStack-allocated closures are one of my favorite features of Rust. They make it easy to write functional-style code that performs well.
- indeyets 10y ago(1) here's how it's done in JS: https://tc39.github.io/ecmascript-asyncawait/#desugaring https://tc39.github.io/ecmascript-asyncawait/#desugaring