News for hackers. Stuff that matters.
Re:Zig self hosted compiler is now capable of building itself by viraptor on Saturday April 16, 2022 @10:16AM (#31052515)
You're commenting on an article about Zig which became self-hosted and can compile C. (There's also lots of other C compilers available)
Re:Zig self hosted compiler is now capable of building itself by dundarious on Saturday April 16, 2022 @10:43AM (#31052710)
Zig compiles C/C++ by deferring the vast majority of the work to libclang, which is written in C++. Also note Zig is self-hosted when using the LLVM backend, which means deferring to C++ for much of the code generation. There is no "end-to-end Zig" self-hosted compiler yet, because the Zig native backends are not as near completion. See the creator's comment about the breakdown: https://news.ycombinator.com/item?id=31052234. (I'm excited about this progress, so this is not meant as any kind of knock on Zig, which I think is quite impressive)

But you're right that C is not a good example.