Comment by peter_d_sherman

6 hours ago

>"The IO parameter is even more powerful, even if it is newer. It is well worth the breaking changes required to bring it about (even if I skipped the 0.15.0 -> 0.16.0 transition). In Zig, every function that interacts with the underlying operating system (with caveats) requires an "IO" parameter. This provides the context for input, output, and everything else.

Porting Zig to new operating systems is mostly just porting IO."

Nice!

(In Software Engineering, I think with this change, Zig nailed Separation Of Concerns: (https://en.wikipedia.org/wiki/Separation_of_concerns) aka modularity/modular design, at least with respect to handling the asymmetries of different OS's I/O APIs/syscalls - rather nicely!)

Anyway, very interesting article!

Related:

https://ziglang.org/download/0.16.0/release-notes.html#IO-as...

https://www.ziglang.in/learn/standard-library/io-interface/