|
|
Log in / Subscribe / Register

One and a half colors

One and a half colors

Posted Dec 3, 2025 15:09 UTC (Wed) by khim (subscriber, #9252)
In reply to: One and a half colors by smurf
Parent article: Zig's new plan for asynchronous programs

> Two colors because one has "async" and one has not, or one requires a somewhat-special "Io" and one does not.

You can easily predict that “sync” is just a special executor that does everything in place. That's trivial transformation and easily done if you may support more than one executor.

> All in all that makes the situation annoying but somewhat manageable.

Yes, but it's kludges on top of kludges. If you can, somehow, adopt the model that may have more than one executor then all the difference fall by wayside automatically because “sync” becomes just an async with trivial executor. But if you don't do that the every time you add new executor you make the mess worse: two executors (certain flavor of async and “sync”) are the typical norm today, three are a mess, try to converge dozen of executors in one app and the whole thing would collapse under its weight.

To untangle that mess we need to, somehow, parametrise our async functions… and Zig does precise that.


to post comments


Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds