> Zig's standard library is structured so that you only compile what you need,
> so Zig has no problems adding richer functionality to its standard library.
That’s orthogonal to both
- whether to compile from source in every compilation unit or to compile once, and use (shared) libraries,
and to
- whether to provide the standard library as a single unit, as is typically done in C, where it is a (shared) library, or as multiple interdependent smaller units as in Zig, where the standard library contains multiple source files.
> HTTP, for example, can go into Zig's standard library,
The claim “you only compile what you need” also is incorrect. Zig’s source files (luckily) aren’t fine-grained enough to support that.
For example, https://github.com/ziglang/zig/blob/master/lib/std/http/Clie... contains stuff that not every user of that module will need, for example connection pools and a function to flush a buffer.
The compiler may not generate code for such unused definitions, but it has to parse them, if only to figure out where the next definition starts.