Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> Doing this well is not easy

Does this also apply to the in-language build system? Given both Rust and Zig's ergonomics, it just seems so brilliantly simple (at least in hindsight) to let the build system be a library. Is it just coincidence that I've only heard of this approach for zig and Jonathan Blow's language, or is there a technical reason this is more difficult than it seems?




> I've only heard of this approach for zig and Jonathan Blow's language

It's the same approach used by nix and guix. Nix is moderately successful. I'm typing this on a laptop running nixos :)

https://nixos.org/

https://guix.gnu.org/

If you're interested in this sort of thing, this is an excellent paper on build system design, although it focuses more on the properties of the build graph than on how the graph is constructed:

https://www.microsoft.com/en-us/research/uploads/prod/2018/0...


I don't know enough about Zig's build system, or Jai's, to be able to talk about their approach intelligently.


The reason it isn't done more often is that it's too much on the imperative side vs declarative builds.


> Is it just coincidence that I've only heard of this approach for zig and Jonathan Blow's language

It's also a feature in elixir (Mix). Interestingly elixir also has a comptime concept, so I think having comptime makes having a build library more sensible.


In case you didn't know, cargo is available as a library as well[0].

I don't know why the current Zig approach[1] would be preferable, as you dump some source code that you are now responsible to maintain in your project. Any bigger project project will require writing boilerplate code just to get things built.

It's also a bit of comparing apples to oranges, as Zig's build system doesn't come with a package manager (which I would say makes up a good chunk of Cargo's complexity).

[0]: https://crates.io/crates/cargo

[1]: https://ziglang.org/#Zig-Build-System




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: