Zig: All Package Management Functionality Moved from Compiler to Build System
21–30 of 109 posts
Re: Zig: All Package Management Functionality Moved from Compiler to Build System
#22Earlier quoted context omitted.
The thing about Zig in these times is that it proves that software development as a craft is not dead or replaced by LLMs. Even though I use LLMs every day, and have to admit they're remarkably good at many classes of problem, I don't want a programming language built by an LLM. Every line of code in a programming language, every decision, every trade off, matters. A vibe-designed/vibe-coded programming language woul…
Sure a human would write the language spec and the llm implement it
1. That a human, even a brilliant human with a lot of experience, can sit down and one-shot a language spec for a new language that is actually good.
2. That an agent can produce code that is good enough for a programming language that intends to last for decades without exhaustive human review.
We might advance to the point where 2 is true, we're not there yet. We'll never make a better human that can one-shot a good programming language. It takes iteration, with a human in the loop. Zig has taken ten years to get to this point, and is still occasionally experiencing major refactors.
If you want to argue an LLM could potentially accelerate development by some amount, I would agree with you. How much it could accelerate it is debatable. And, I understand why the Zig folks have decided not to accelerate in that way. There is a cost to it. You lose the junior programmer pipeline, as your "good first bug" list gets chewed up by people using LLMs. You still have to exhaustively review the code for a critical path like a compiler and AI code is hard to review; it doesn't have a point to it. The model doesn't want anything, so it's not always clear where it's going. Code without clear intention, like prose without clear intention, is hard to read and hard to review. It's verbose and often makes weird assumptions.
If I, for some reason, needed to implement a tiny DSL for something, I would 100% do it with an LLM. If I, for some reason, were tasked with building the best programming language to replace C, I would not hand it to an LLM (though I would get help from an LLM, because I don't know how to build a programming language beyond the tiniest toy interpreter or compiler, I'd need to read and understand every line of code, and use it daily, for it to turn out good).
Re: Zig: All Package Management Functionality Moved from Compiler to Build System
#23Re: Zig: All Package Management Functionality Moved from Compiler to Build System
#24Earlier quoted context omitted.
What’s the advantage of that for building?
sandboxing, which feels a weird way to achieve that. Although the reason for it to begin with is because builds systems can typically access raw memory and disable artificial restrictions. I think this is a bad move since the real fix to these attacks is a sandboxed environment rather than a single tool implementing sandboxing.
Re: Zig: All Package Management Functionality Moved from Compiler to Build System
#25Earlier quoted context omitted.
The thing about Zig in these times is that it proves that software development as a craft is not dead or replaced by LLMs. Even though I use LLMs every day, and have to admit they're remarkably good at many classes of problem, I don't want a programming language built by an LLM. Every line of code in a programming language, every decision, every trade off, matters. A vibe-designed/vibe-coded programming language woul…
Sure a human would write the language spec and the llm implement it
Plus, current-gen agents/LLMs can't implement a non-trivial language spec without significant hand-holding.
Re: Zig: All Package Management Functionality Moved from Compiler to Build System
#26Everytime I see a language creating their own package system, all I can think of it how much we've missed here. The only exception is C/C++, where there is none established that well, for good or bad. These choices may create later super-convoluted processes when you have to mix more than one language together. Packaging systems makes thing easy, but complicate further the line if another language needs to be used.
Re: Zig: All Package Management Functionality Moved from Compiler to Build System
#27I've read somewhere that the longer-term goal is to move the build system into a WebAssembly VM. If so, this is incredible.
What’s the advantage of that for building?
But when looking at open source code you don't trust yet, you might want to build code, without running it, so your development tools will work.
Re: Zig: All Package Management Functionality Moved from Compiler to Build System
#28Everytime I see a language creating their own package system, all I can think of it how much we've missed here. The only exception is C/C++, where there is none established that well, for good or bad. These choices may create later super-convoluted processes when you have to mix more than one language together. Packaging systems makes thing easy, but complicate further the line if another language needs to be used.
What do you think we've missed? Do you want one build systems for all languages? There are such systems (e.g. Bazel) and they're often used for multi-languages projects, but I think reality has proven that build systems with language-specific knowledge are much easier to navigate.
Fixing this is beyond any one tool, of course :)
Re: Zig: All Package Management Functionality Moved from Compiler to Build System
#29I've read somewhere that the longer-term goal is to move the build system into a WebAssembly VM. If so, this is incredible.
What’s the advantage of that for building?
I added WASM/WASI bindings and wrote the prelude in Haskell.
Both the bindings and the prelude took less time than I already wasted on multiple attempts in Starlark that all collapsed into string goop.
It's nice to be able to bound the execution environment in a build tool but still use a serious programming language.
Given Zig has excellent support for targeting WASM, seems you'd get the same advantages.
Re: Zig: All Package Management Functionality Moved from Compiler to Build System
#30Earlier quoted context omitted.
How would you do it, then? Sandboxing a project's build.zig via Wasm (and the various dependencies's build.zig files) seems like a great improvement to me and is how I would personally try to sandbox the build process.
I don't know what build.zig commonly does, but in Rust build.rs often does things like compiling C/C++ libraries, so you can't sandbox it with WASM (contrary to proc macros, which most of the times can be compiled to WASM and there were/are efforts for that). How does Zig fare with that?
In theory, you could run the whole compiler (including C) in WASM as well but I don’t think that’s the goal? You kinda need to trust the compiler itself.