Skip to content

Comment on Lessons from Zig

Comments

The Zig programming language maintains an intentionally small standard library.

Zig's standard library is not that small to be honest. It has lots of useful tools that do not exist in other languages. The compiler uses the std.

HTTP clients, for example, are considered inappropriate for a general-purpose systems language’s standard library.

The std has both HTTP client, server, TLS and in development branch even a DNS resolver.

C++ cannot replicate Zig’s approach exactly—ABI stability and decades of deployed code make removal far more complex.

Wild to hear C++ and ABI stability in same sentence.

Though the article seems LLM generated and even website title is "My Very Best AI Slop", I'm not sure what to expect or why this is even on HN front page.

Not to mention that Rust too had "let's have the minimalistic stdlib for now, let the community figure out the rest" approach and the results are somewhat mixed.

In what way? There was an stdx[1] crate that was basically extra stuff like regex, http client/server, json parsers but there was little desire to maintain it.

[1] https://github.com/brson/stdx?tab=readme-ov-file#stdx---the-...

Edit: Andrew confirmed that the HTTP client and server will stay in the standard library.

Regarding HTTP in Zig std library, might some of the API not be removed in the future?

https://github.com/ziglang/zig/issues/910#issuecomment-39548...

That's from 2018. I think it's unlikely. Also zig's package manager needs a HTTP client.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.