4 ms·
> Zig's explicit goal - as stated by the creator - is to replace C. Nothing more, nothing less. The ZIG compiler requires a C compiler to compile to a native e
by jhoechtl 5y ago
> Zig's explicit goal - as stated by the creator - is to replace C. Nothing more, nothing less.
The ZIG compiler requires a C compiler to compile to a native executable though.
- Twisol 5y agoTo 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.
- wyldfire 5y ago> 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.
- AndyKelley 5y agoHere's the info on zld status: https://ziglang.org/download/0.8.0/release-notes.html#Self-Hosted-Linker 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 https://github.com/Vexu/arocc
- messe 5y ago> 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.