3 ms·
> Some of those have fairly simple semantics though. I'd disagree with that. Yes technically, a generator is just a enum representing a state machine that can
by the_duke 7y ago
> Some of those have fairly simple semantics though.
I'd disagree with that. Yes technically, a generator is just a enum representing a state machine that can be stepped through. And async/await is just a generator with some extra compiler utility.
But they completely change how code is executed, to the point that you don't really think about it as a state machine and have to work hard (mentally) to reconstruct what is happening under the hood. Debugging gets much more complex. And it also adds another part that you need to understand and work with.
Async/await is particularly bad because it's not a standalone feature: it comes with a large ecosystem of crates that provide streams, executors, reactors, timers, ....
It's a huge strain on the complexity budget.