I’ve said it before, but I think the long term role of any good standard library, is to be the foundation of the ecosystem, it should be filled to the brim with the right high impact bricks, Allocator interface, Random interface, Io interface, Reader/Writer interface, Data structure, iterator abstraction, cryptography, networking, file system, Basically a core from which the whole ecosystem can be built with an interop layer (to me a good std is kind of a language on top of a language it’s really important).
We can already see it in practice, if you fetch any Zig package, if it does memory allocation you can pick the allocator to fit your needs, if a package needs an Hash map, you don’t have to fetch FooBar’s Hashmap on github, you can just take the one in std.
Now the biggest advancement recently has been Io, having a way to control and schedule any library to fit your needs, is absolute godsend. I can’t begin to explain how frustrating it has been for me to see amazing industry standard C/C++ library, which would have been a perfect fit got to waste, because I couldn’t actually control the scheduling of operations, without needing to make a soft fork.
The one example that I have in mind is Libcamera, Libcamera is a library to use, configure, and manipulate cameras, isp, encoder/decoder, transform etc. It’s the industry standard, and it supports a ton of platform, android, raspberry, and many more, but because it supports a lot of platform, Libcamera is built around threads (with a Qt like signal layer), which on a tiny raspberry pi is super wasteful if you are already hammering the CPU with computer vision tasks.
At work I would have loved to use Libcamera, and in fact the project initially was using it, but because we couldn’t integrate it with the refactor of the whole application around an epoll loop, I had to code a worse, but more optimized “mini Libcamera”, built in C around epoll and v4l2, which was tremendously more efficient, and suited for my usecase, where readiness is indicated with dmafd polling, and h264/yuv readiness is indicated with eventfd, to dedicated worker thread.
This was a lot of work, and I had to reimplement everything, the runtime, the initialization, the capabilities negotiation, the ISP’s meta-data handling to implement color correction, Automatic Exposure, White balance, even parsing the Libcamera’s JSON tuning format, even if it was necessary for the goal set in my project, and I was successful.
I still consider this work a pure and complete waste of time (outside of the fact it was very interesting to learn and get nerd sniped into), because my code is objectively worse than the one in Libcamera, it’s not standard, it doesn’t have full feature parity, and I have to actively maintain it.
All of this would have been solved with the Io interface, because instead of being forced to make my code work around the decision of upstream, I could have fit upstream around my needs, and have it work around me not the opposite.
So to me I think the std, should focus on those building block, giving the ecosystem the foundation to build, and interoperate, to maximize flexibility and code reuse. And in my perfect world, there would also be a std-contrib, similar to opencv where opencv core is the well maintained, guarantee tier one code, and opencv-contrib is the experimental, often SOTA, but still too early code, that you can use, and rely on but without any guarantee for it’s long term support.
I would love for Zig to take that direction, separate what should be core in the std, from what shouldn’t be for example the http module, I’m not sure it’s necessary to be part of the final 1.0 std, but instead i would love to see http.zig be promoted to some kind of std-contrib, because it’s such a great project, and while http itself probably isn’t “core” some kind of “hey this is what we have elected to be a great baseline” from which anyone can build upon seems like the best of both world.
The core maintainers, focus on shaping the building blocks, with direct feedback from the std-contrib maintainers who got their package promoted/vendored. It makes it easier to pick the right package, and promotes code reuse.