4 ms·
> 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 (
by mtzet 6y ago
> 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?
- steveklabnik 6y agoI don't know enough about Zig's build system, or Jai's, to be able to talk about their approach intelligently.
- hobofan 6y agoIn 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 https://crates.io/crates/cargo [1]: https://ziglang.org/#Zig-Build-System https://ziglang.org/#Zig-Build-System
- dnautics 6y ago> 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.
- p0nce 6y agoThe reason it isn't done more often is that it's too much on the imperative side vs declarative builds.
- jamii 6y ago> 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://nixos.org/ https://guix.gnu.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/03/build-systems-final.pdf https://www.microsoft.com/en-us/research/uploads/prod/2018/0...