3 ms·
How was it implemented in the past? Is there any overview of the design iterations Zig has gone through? Seems like Rust is still working on this area with th
by chubot 3y ago
How was it implemented in the past? Is there any overview of the design iterations Zig has gone through?
Seems like Rust is still working on this area with the controversial keyword generics
- somethingor 3y agohttps://kristoff.it/blog/zig-colorblind-async-await/ https://kristoff.it/blog/zig-colorblind-async-await/
- hinkley 3y agoI can't tell from the examples. Does Zig's async support closures or is it strictly out of order execution?
- wredue 3y agoZig does not have closures, and probably never will barring someone coming up with a nice, no hidden flow idea for captures.
- laserbeam 3y agoIt's similar to manual control over the current stack. You pause execution, you dump your current stack onto the heap, and restore it later. Control over concurrency, similar to out of order execution. I'm describing it conceptually but I assume the implementation can be/was smarter/faster. I don't think closures have anything to do with it. There was also some debate about how cancelation of an awaitable function built with those primitives would work. I don't think there was a great answer for that yet.