3 ms·
> No, because you would just pass that extra argument around and nothing else would have to change. > Semantically, passing std.Io to every function is no diff
by ivanjermakov 1y ago
> No, because you would just pass that extra argument around and nothing else would have to change.
> Semantically, passing std.Io to every function is no different from making every Node.js function async and returning a promise. Zig shifts function coloring from blocking/non-blocking choice to io/non-io.
> Complains are about how inconvenient it is to work with [blocking and non-blocking function handling] differences
"Extra argument" in this case is not much different from "extra async keyword", because you can only run I/O functions when having std.Io in scope.
- Dylan16807 1y agoThey're similar, but if you're not writing Haskell it's super easy to make a variable always be in scope. You don't have to change all the intermediate functions to do it.