|
|
Log in / Subscribe / Register

One and a half colors

One and a half colors

Posted Dec 3, 2025 10:17 UTC (Wed) by spiffyk (subscriber, #173891)
In reply to: One and a half colors by pbonzini
Parent article: Zig's new plan for asynchronous programs

As I understand it, the way the function will ultimately be compiled is entirely up to the chosen implementation of the Io interface. May be stackful, may be stackless – the point is that to the function taking the Io parameter, this is just a transparent implementation detail.

What is important to note is that the language provides no special treatment to the Io parameter, it is entirely an API convention to pass it. Io is an extension of the standard library, which in and of itself does not change how the language works. The only point at which the compiler itself will need to provide special functionality is when an implementation of the Io interface uses the (as of yet not finalized, afaik) constructs for stackless coroutines. But those are planned to be a separate feature of the language, and, from the perspective of the Io, will only be used by specific Io implementations.


to post comments


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