> 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.

I guess the difference is zig doesn’t even properly type check a function if you didn’t use it. Whereas rust relies on the linker to remove machine code after that code went through the entire compiler pipeline.

Zig not even type checking some code when compiling felt a bit off but now I just try to make sure all code is at least being smoke tested, so I don’t get random compilation errors down the line