Remix.run Logo
woodruffw 44 minutes ago

> 1) zig's io is not an effect type, you can in principle declare a global io variable and use it everywhere that any library calls for it.

That's an effect, akin to globally intermediated I/O in a managed runtime.

To make it intuitive: if you have a global token for I/O, does your concurrent program need to synchronize on it in order to operate soundly? Do programs that fail to obtain the token behave correctly?

throwawaymaths 33 minutes ago | parent [-]

how do you "fail to obtain the token"?

woodruffw 30 minutes ago | parent [-]

The token guards a fallible resource (I/O). You can (temporarily or permanently) fail to obtain it for any reason that would affect the underlying I/O.