To be fair, the C compiler also requires a C compiler. Bootstrapping is a common milestone in language development (Rust can bootstrap itself too), so while the current state of affairs for Zig might require a C compiler, that's not necessarily written in stone.
> The ZIG compiler requires a C compiler to compile to a native executable though.
Do you mean compiling the zig compiler or zig programs?
I think neither is quite the case. zig itself can build both Zig programs and C/C++ ones. Zig doesn't need to use a C compiler to build native Zig executables. It does need a linker, as does Rust, as do C/C++ programs and AFAIK zld is not yet ready.
However it's accurate to say that it's only able to compile the C/C++ code by leveraging libclang, the C/C++ compiler underneath.
Re:Maintain It with Zig
by AndyKelley on Wednesday September 08, 2021 @03:49PM
(#28462134)
Here's the info on zld status: https://ziglang.org/download/0.8.0/release-notes.html#Self-H...
By the way, check out this project by Zig core team member, Vexu: https://github.com/Vexu/arocc
> The ZIG compiler requires a C compiler to compile to a native executable though.
No it doesn't? Not unless you want to also compile C, which the Zig compiler is capable of doing because it bundles clang.
The ZIG compiler requires a C compiler to compile to a native executable though.