News for hackers. Stuff that matters.
Re:Zig is now self–hosted by default by endgame on Saturday August 20, 2022 @07:49AM (#32531294)
Very exciting. Are there plans to maintain the bootstrap path over the longer term? It always makes me sad when I hear about compilers which must bootstrap from magic binary blobs.
Re:Zig is now self–hosted by default by nyberg on Saturday August 20, 2022 @08:29AM (#32531540)
Re:Zig is now self–hosted by default by Schroedingersat on Saturday August 20, 2022 @08:36AM (#32531575)
I believe the goal is to replace the C++ with a C bootstrap that is initially auto generated from the zig code by zig but manually cleaned up and maintained to match
Re:Zig is now self–hosted by default by pabs3 on Saturday August 20, 2022 @08:49AM (#32531668)
Starting from auto-generated code isn't considered a proper bootstrap process by the Bootstrappable Builds project. You need to be able to start without any binaries or auto-generated code from the project itself. Usually that would mean starting with a basic implementation in another language, but starting with an older version of the same project that was written in another language and then going through several older versions of different milestones is often easier than reimplementing the language from scratch in another language.

https://bootstrappable.org/

Re:Zig is now self–hosted by default by Kamq on Saturday August 20, 2022 @12:09PM (#32533062)
> Starting from auto-generated code isn't considered a proper bootstrap process by the Bootstrappable Builds project.

Is there a reason we should weigh the Bootstrappable Builds project's opinion highly here?

There's nothing on their benefits page that is subverted by an auto-generated compiler that's hand maintained.

Actually, there's no mention of auto-generated code in their best-practices section. Do you have a link to where they even say this?

Re:Zig is now self–hosted by default by pjmlp on Saturday August 20, 2022 @12:12PM (#32533091)
I am quite sure bootstraping as concept, precedes by several decades that website.
Re:Zig is now self–hosted by default by Schroedingersat on Saturday August 20, 2022 @09:18AM (#32531860)
Please read comments before responding
Re:Zig is now self–hosted by default by edflsafoiewq on Saturday August 20, 2022 @10:57AM (#32532481)
Why?
Re:Zig is now self–hosted by default by hiccuphippo on Saturday August 20, 2022 @11:16AM (#32532630)
Probably because they'll start adding features to the Zig version that might not be trivially portable to the C++ version due to architectural differences.
Re:Zig is now self–hosted by default by Gibbon1 on Saturday August 20, 2022 @05:05PM (#32535133)
I think because Zig compilers can compile C but not C++.
Re:Zig is now self–hosted by default by int_19h on Saturday August 20, 2022 @05:37PM (#32535328)
Zig can compile C++ just fine. Which is no surprise, since it's Clang doing the heavy lifting - Zig provides the convenient CLI.
Re:Zig is now self–hosted by default by anonymoushn on Saturday August 20, 2022 @08:16AM (#32531458)
I hope so, but it seems like even if they didn't maintain it you could build today's stage1 using LLVM 14 and then work from the resulting binary instead of a binary you downloaded from online.
Re:Zig is now self–hosted by default by hiccuphippo on Saturday August 20, 2022 @11:24AM (#32532694)
They have a project for maintaining this: https://github.com/ziglang/zig-bootstrap
Re:Zig is now self–hosted by default by boomer918 on Saturday August 20, 2022 @12:32PM (#32533254)
C++ stage1 compiler is a magic binary blob :)
Re:Zig is now self–hosted by default by movq on Saturday August 20, 2022 @12:42PM (#32533337)
It's possible to bootstrap GCC starting from only a 357-byte binary seed: https://github.com/fosslinux/live-bootstrap
Re:Zig is now self–hosted by default by solarkraft on Saturday August 20, 2022 @05:08PM (#32535146)
This work is impressive, but ... that's still a binary blob, and isn't the system it has to be run on kind of one as well?
Re:Zig is now self–hosted by default by movq on Saturday August 20, 2022 @05:59PM (#32535516)
Yeah, it's a binary blob, but it's small enough to be easily auditable. Anyone with some knowledge of x86 assembly can read the annotated version [1] and verify that it does what it claims (which is to convert ASCII hex with comments into binary).

You're right, it also requires a Linux kernel, and of course, you also have to trust the hardware you're running it on. Still, it reduces the amount of stuff we have to take for granted as trusted, which I think is a good thing. (I'm not involved in the project, just an admirer).

[1]: https://github.com/oriansj/bootstrap-seeds/blob/b09a8b8cbcb6...