To clarify what this means, since things can get confusing with subtle differences in wordings: * stage1 is when zig is built from C++ code[1] (the "bootstrap" compiler) using system C/C++ compiler toolchain. * stage2 is when zig is built from Zig code[2] using stage1. * stage3 is when zig is rebuilt from the same Zig code[2] using stage2. Before today, zig would give you stage1 by default, and you could opt in to st…
Congratulations. This is an important milestone.
Zig is now self–hosted by default
41–50 of 115 posts
Re: Zig is now self–hosted by default
#42To clarify what this means, since things can get confusing with subtle differences in wordings: * stage1 is when zig is built from C++ code[1] (the "bootstrap" compiler) using system C/C++ compiler toolchain. * stage2 is when zig is built from Zig code[2] using stage1. * stage3 is when zig is rebuilt from the same Zig code[2] using stage2. Before today, zig would give you stage1 by default, and you could opt in to st…
> * Zig's std lib data structures are incredibly useful, especially compared to the C++ STL. I think elaborating on this could make for a very interesting article. :-) (I have a guess already at one item, which is MultiArrayList, something that kind of blew my mind when I first learned about it, and is in my opinion a very impressive testament to both the power and ease of use of Zig's approach to compile-time comput…
https://github.com/ziglang/zig/blob/master/lib/std/multi_arr...
Re: Zig is now self–hosted by default
#43> Memory usage is improved by a factor of about 3x. For Zig, building itself went from using 9.1 GiB to 2.7 GiB. Pretty impressive.
Re: Zig is now self–hosted by default
#44You either have to set up an ever increasing chain of compilers, as the complexity of the language and the features required to build the compiler grows, or rely on pre-existing binaries. Either way, it seems like a nightmare compared to keeping it in plain old C and building with any compiler of your choice. Just Imagine if any project did this, like, building Firefox now requires an existing Firefox installation.
Re: Zig is now self–hosted by default
#45> Memory usage is improved by a factor of about 3x. For Zig, building itself went from using 9.1 GiB to 2.7 GiB. Pretty impressive.
Re: Zig is now self–hosted by default
#46Earlier quoted context omitted.
You can use it today!
Is there any IDE support? Any debugger?
Re: Zig is now self–hosted by default
#47I never understood why "self-hosting" is considered a good thing. Sure, the compiler developers can write in their favorite language and I guess it means the language is stable enough to be used in a complex project; however requiring an (older) compiler to build the compiler seems a significant complication for software distributions. You either have to set up an ever increasing chain of compilers, as the complexity…
Re: Zig is now self–hosted by default
#48I never understood why "self-hosting" is considered a good thing. Sure, the compiler developers can write in their favorite language and I guess it means the language is stable enough to be used in a complex project; however requiring an (older) compiler to build the compiler seems a significant complication for software distributions. You either have to set up an ever increasing chain of compilers, as the complexity…
But this is exactly the same for C! Building C compiler requires an existing C compiler. C compilers are admittedly more widely available at the moment, but that probably won't be the case forever. Languages like zig aim to supplant C. How are they supposed to do that when they're directly dependent on C?
Re: Zig is now self–hosted by default
#49I never understood why "self-hosting" is considered a good thing. Sure, the compiler developers can write in their favorite language and I guess it means the language is stable enough to be used in a complex project; however requiring an (older) compiler to build the compiler seems a significant complication for software distributions. You either have to set up an ever increasing chain of compilers, as the complexity…
Re: Zig is now self–hosted by default
#50I never understood why "self-hosting" is considered a good thing. Sure, the compiler developers can write in their favorite language and I guess it means the language is stable enough to be used in a complex project; however requiring an (older) compiler to build the compiler seems a significant complication for software distributions. You either have to set up an ever increasing chain of compilers, as the complexity…
[1]: https://en.m.wikipedia.org/wiki/Eating_your_own_dog_food