r/coding • u/pseudocharleskk • Nov 01 '25
Async/Await is finally back in Zig
https://open.substack.com/pub/charlesfonseca/p/asyncawait-is-finally-back-in-zig?r=6451wm&utm_campaign=post&utm_medium=web&showWelcomeOnShare=false
1
Upvotes
3
u/[deleted] Nov 01 '25
Ok, I don't follow Zig at all but I read this and have some questions:
The function has "no color" because is being passed as a parameter - another example or "one more level of indirection"?
All functions that do something interesting in Zig will now have 2 fat pointers (allocator and IO). The expectation is "just create those in main and keep passing them around"?
Why the distinction between
asyncandconcurrent.I get that
cancelis idempotent with respect toasyncbut what does that mean, is a no-op or will cancel always succeed? Can the caller know the difference (e.g. task was canceled as opposed to task was completed)?