Re:Zero-cost futures in Rust
by moosingin3space on Thursday August 11, 2016 @12:03PM
(#12269345)
Stack-allocated closures are one of my favorite features of Rust. They make it easy to write functional-style code that performs well.
(1) here's how it's done in JS: https://tc39.github.io/ecmascript-asyncawait/#desugaring
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!