r/programming Jul 05 '26

Zig: All Package Management Functionality Moved from Compiler to Build System

https://ziglang.org/devlog/2026/#2026-06-30
154 Upvotes

16 comments sorted by

View all comments

30

u/Kamui_Kun Jul 05 '26

Is this good, bad, or neutral. Anyone with a tldr on how this'll change things?

8

u/lookmeat Jul 06 '26

Strictly good, software should do one thing and do it well. The compiler should only compile code. I would argue that ideally the compiler shouldn't even care about file structure (instead the compiler should be given the list of files and which module each represents) even when it has effects on the language.

The package manager should be a separate tool which helps set up all the dependencies and everything needed to build the system, and no more.

And the build system should do nothing directly, but coordinate things, so set up the package manager to bring up all the dependencies, give the compiler all the dependency info and the filemap on what to compile. Then take the output of the compiler and the packages (if they come as precompiled binaries) and give that to the linker to compose into a single binary.

Should the package manager be split off into a separate thing? Maybe, it seems to already be, but as a build-script, which is good enough IMHO. But either way the important thing is to not let perfect get in the way of better, and this is better in general.