One and a half colors
One and a half colors
Posted Dec 3, 2025 9:17 UTC (Wed) by pbonzini (subscriber, #60935)In reply to: One and a half colors by khim
Parent article: Zig's new plan for asynchronous programs
I would like to understand how IO functions are compiled. If they are stackful coroutines, Zig's solution is very clever but that's a very different design space than the stackless coroutines you have in Rust or, for that matter, in Zig's previous attempt at asynchronous I/O. Stackless coroutines need compiler support but are more efficient (a couple years back I had a (IMO) really nice design for C stackless coroutines, but no time to implement it...).
Or does the compiler effectively treat the IO argument as a request to turn the function into a state machine and pass it to the threaded or evented run-time?
