Re:Asynchronous IO in Rust
by dbaupp on Thursday September 17, 2015 @01:49AM
(#10231750)
The first point has been on the radar for quite a while (i.e. years), but it's really non-trivial, and not at all necessary for the core language (hence not a priority for stability) since it's basically just some syntactic niceties over existing functionality.
[ Parent
| on HN ]
> it's basically just some syntactic niceties over existing functionality.
OK, cool! Can you point us to the existing functionality, or any example of it being used for stackless coroutines?
Enums. This HN submission is an example.
State machines aren't a general solution — you have to write a state machine by hand for every application.
Stackless coroutines are — the compiler (or a clever library) transforms your ordinary function into a state machine.
Yes, I know. That's exactly what I mean by syntactic sugar: it is an automated way to write something that could already be written, but is annoying to do by hand.