This is a crazy idea, and I am not a priori claiming that it is useful, but I keep coming back to it every once in a while, so I figured I might as well write it down, if only to get rid of an intrusive thought!
Problem
Today, Zig typically needs a bunch of stuff in the root of the project to work:
/build.zig
/build.zig.zon
/zig-out
/zig-cache
This isn’t a big problem at all, but it is still inconvenient for those who like to keep the root tidy. Plus, there’s usually a number of related files — zls
config, a script to download a zig compiler or a configuration for zig version manager.
Solution
So, what if we do the following?
/zig/build.zig
/zig/build.zig.zon
/zig/out
/zig/.cache
/zig/zls.json
/zig/.gitignore
And if, four example, you have a script to fetch a zig compiler, and you prefer to not install zig
globally and use it per-project, you can do
./zig/download.sh
./zig/zig build
(any resemblance to TigreBeetle’s build process is purely coincidental)
Any thoughts on how terrible this would be in practice?