Zig build system internals
mitchellh.com
mitchellh.com
Compare with Bazel's Skylark language, which is approximately a subset of Python.
Since an imperative language is doing declarative things, there can be a bit of confusion unless you're clear about how it works.
> the build binary is defined in lib/std/special/build_runner.zig. It isn’t complicated and I recommend you read the file.
it would be very helpful if that was actually a link to the repo.
https://github.com/ziglang/zig
The code in the lib/std directory is very readable, and I’d strongly encourage checking it out for anybody who wants to learn Zig or know what idiomatic Zig looks like.
But the rest of 90% tasks should have compact (easily readable) definitions.
I personally found that Premake5 has quite good balance for these tasks.
Premake files are plain .lua files and due to Lua syntax they are easily readable. And if needed you can call from them procedures defined in again Lua.
So typical project (multiplatform) definition looks pretty readable, for example one project from Sciter SDK:
https://github.com/c-smile/sciter-js-sdk/blob/main/premake5....
Actually, many of them probably don’t even need the most of the build system at all if they’re intended only to be imported by other zig projects as libraries.
I’d argue that Zig definitely makes the easy case trivial and the hard case possible here.
Build ZIG.
For great justice.