Very, very excited for the build server protocol and ZLS work that’s forthcoming. The initial work looks great and having a standard about what a build server should do will hopefully allow for some community convergence. LSP has been incredible for me and I’m hoping that there’s a chance we can have more standards like it (maybe ones that are a little less Microsoft-y, but I’ll take what I can get). I know of this protocol but it seems like it didn’t have any reach outside of Java land.
Great to see the Zig project making steady progress. I genuinely love the ethos and the attention to detail that the core team has shown so far.
What keeps impressing me is that the ambition seems to extend well beyond designing a nice language. There is a lot of painstaking work going into making the whole toolchain coherent: compiler, linker, build system, cross-compilation, tooling, and now things like the Build Server Protocol. That feels like a much harder problem than adding individual language features, but potentially a much more impactful one.
I don't always agree with their strict anti-AI stance, but at the same time, seeing what they manage to accomplish while sticking to those principles makes their efforts all the more commendable.
So, the SafeAllocator talks about how it doesn't re-use memory if the backing allocator doesn't re-use memory, does that mean that long-term use of it, in, say, a web service would ultimately use up all the memory available to a process then?
You can ask OS to always give you a fresh address, even if you give completely free pages back. (of course, if anything on the page is alive, you can't give it back).
That confused me for a second too, but I think that's the point. I assume the idea (that I'm not totally sold on) is that you will hardly ever have a long-running enough debug build process for it to be an actual issue more often than you will really need to reuse memory while debugging code. This is in exchange for being "absolutely certain" that your program did not have any UAFs, double frees, OOB, etc. if you're using it like intended. I think it's a weird default but a sensible design in and of itself.
It was today I wrote some fuzzer code where I got frustrated that the self-hosted debug backend could not compile fuzzer tests. I should have waited a few hours.
Safe optimization mode is better for fuzzing because you want both assertions enabled and for the checks to run as fast as possible to give more chance for the genetic algorithm to find interesting inputs.
It makes sense and I tried that, but then I did not get any hints where my code had failed, the references only pointed into the std lib. Though I might have missed something I should have set or done.
kneeawn | 23 hours ago
Very, very excited for the build server protocol and ZLS work that’s forthcoming. The initial work looks great and having a standard about what a build server should do will hopefully allow for some community convergence. LSP has been incredible for me and I’m hoping that there’s a chance we can have more standards like it (maybe ones that are a little less Microsoft-y, but I’ll take what I can get). I know of this protocol but it seems like it didn’t have any reach outside of Java land.
loige | 6 hours ago
Great to see the Zig project making steady progress. I genuinely love the ethos and the attention to detail that the core team has shown so far.
What keeps impressing me is that the ambition seems to extend well beyond designing a nice language. There is a lot of painstaking work going into making the whole toolchain coherent: compiler, linker, build system, cross-compilation, tooling, and now things like the Build Server Protocol. That feels like a much harder problem than adding individual language features, but potentially a much more impactful one.
I don't always agree with their strict anti-AI stance, but at the same time, seeing what they manage to accomplish while sticking to those principles makes their efforts all the more commendable.
fuzzypixelz | 14 hours ago
Fun discussion on why
i0existed but is removed in this release: https://github.com/ziglang/zig/issues/1593yumaikas | 6 hours ago
So, the SafeAllocator talks about how it doesn't re-use memory if the backing allocator doesn't re-use memory, does that mean that long-term use of it, in, say, a web service would ultimately use up all the memory available to a process then?
matklad | 2 hours ago
You can free memory without re-using it, thanks to virtual memory. See
https://codeberg.org/ziglang/zig/src/commit/996321250d9a9438fc65fcfe64a0d6ada04e50a0/lib/std/heap/PageAllocator.zig#L43
You can ask OS to always give you a fresh address, even if you give completely free pages back. (of course, if anything on the page is alive, you can't give it back).
fanf | 39 minutes ago
And thanks to 64 bit address spaces :-) It’s quite easy to consume 4GB at even relatively modest allocation rates.
interlandi | 2 hours ago
That confused me for a second too, but I think that's the point. I assume the idea (that I'm not totally sold on) is that you will hardly ever have a long-running enough debug build process for it to be an actual issue more often than you will really need to reuse memory while debugging code. This is in exchange for being "absolutely certain" that your program did not have any UAFs, double frees, OOB, etc. if you're using it like intended. I think it's a weird default but a sensible design in and of itself.
interlandi | 3 hours ago
This pull request may go down in history as one of the coolest the project has ever seen.
Generating recursive descent parsers is not easy, let alone readable ones that pass fuzzing.
baer | 23 hours ago
It was today I wrote some fuzzer code where I got frustrated that the self-hosted debug backend could not compile fuzzer tests. I should have waited a few hours.
andrewrk | 23 hours ago
Safe optimization mode is better for fuzzing because you want both assertions enabled and for the checks to run as fast as possible to give more chance for the genetic algorithm to find interesting inputs.
baer | 22 hours ago
It makes sense and I tried that, but then I did not get any hints where my code had failed, the references only pointed into the std lib. Though I might have missed something I should have set or done.
vulcan | 19 hours ago
Generally, once a fuzzer finds a failure it should spit out a seed you can use to reproduce on a debug build.
I'm not familiar with zig's fuzzer but I'm sure it has something analogous.