▲ | pkolaczk 2 days ago | |
The parent comment is right. Rust async is simple state automata structs you can poll explicitly with no magic. Async/await is just some syntactic sugar on top of that, but you don’t have to use it. An obvious advantage of doing it that way is you don’t need any runtime/OS-level support. Eg your runtime doesn’t need to even have a concept of threads. It works on bare metal embedded. Another advantage is that it’s fully cooperative model. No magic preemption. You control the points where the switch can happen, there is no magic stuff suddenly running in background and messing up the state. | ||
▲ | jpc0 2 days ago | parent | next [-] | |
Have you actually tried to implement async in rust from the ground up. It is nothing like what you just described | ||
▲ | tptacek 2 days ago | parent | prev [-] | |
I didn't say it was good or bad. I said it's new-school colored functions. |