One and a half colors
One and a half colors
Posted Dec 2, 2025 22:23 UTC (Tue) by khim (subscriber, #9252)In reply to: One and a half colors by excors
Parent article: Zig's new plan for asynchronous programs
That's much better solution that what Rust did. Of course Zig has the benefits of hindsight.
In practice there are more than two colors — except in Rust it's not obvious from the source and almost unmanageable in practice.
That's because you couldn't simply pass any random async function into any random executor… the functions that do actual work have to match the executor or else the whole things falls apart — and these functions are invisible in Rust's async fn signature.
In Zig one may simply have more than two implementations of the interface.
People are talking about “two colors” because in practice that's something that actually works, but try to mix two executors in one program in Rust… and the whole thing falls apart, you couldn't do that. It's not “2 colors” problem, but “2+ colors problem”.
