A lot of languages claim to be a C replacement, but Zig is the second language I've seen that seemed like it had a reasonable plan to do so at any appreciable scale. The language makes working with the C ABI pretty easy, but it also has a build system that can seamlessly integrate Zig and C together, as well as having a translate-c that actually works shockingly well in the code I've put through it.
The only thing it didn't do was be 99% compatible with existing C codebases...which was the C++ strategy, the first language I can think of with such a plan. And frankly, I think Zig keeping C's relative simplicity while avoiding some of the pitfalls of the language proper was the better play.
D can compile a project with a C and a D source file with:
dmd foo.d bar.c
./fooBecause doesn’t OpenBSD block direct syscalls & force everything to go through libc.
How does that work, with syscalls being unable to be called except from the system’s libc? I’d be a bit surprised if any binary’s embedded libc would support this model.
Let's say I'm building a C program targeting Windows with MinGW & only using Zig as a cross compiler. Is there a way to still statically link MinGW's libc implementation or does this mean that's going away and I can only statically link ziglibc even if it looks like MinGW from the outside?
If you specify -target x86_64-windows-gnu -lc then some libc functions are provided by Zig, some are provided by vendored mingw-w64 C files, and you don't need mingw-w64 installed separately; Zig provides everything.
You can still pass --libc libc.txt to link against an externally provided libc, such as a separate mingw-w64 installation you have lying around, or even your own libc installation if you want to mess around with that.
Both situations unchanged.
That's a good way to sell moving over to the zig build system, and eventually zig the language itself in some real-world scenarios imo.
while we're talking about printf, can i incept in you the idea of making an io.printf function that does print-then-flush?
- c-ward [0] a libc implementation in Rust
- relibc [1] a libc implementation in Rust mainly for use in the Redox os (but works with linux as well)
- rustix [2] safe bindings to posix apis without using C
[0]: https://github.com/sunfishcode/c-ward
This is exciting! I particularly care more about kqueue but I guess the quote applies to it too.
Why is the linker too late? Is Zig able to do optimizations in the frontend that, e.g., a linker working with LLVM IR is not?
LTO essentially means “load the entire compiler backend into the linker and do half of the compilation work at link time”.
It’s a great big hack, but it does work.
Just joking of course. Those are sadly only in glibc.. :)
The biggest thing holding me back from using Zig for important projects is the willingness of my peers to adopt it, but I'm just building projects that I can build myself until they are convinced :)
You might find this interesting: https://www.youtube.com/watch?v=x3hOiOcbgeA
I expect a lot of C code may be quite mechanically translated to Zig (by help of LLMs). Unlike C->Rust or C->C++, where there's more of a paradigm shift.
You would need to consider if it is even worth it translating your C code. If the paradigm is identical and the entire purpose would be "haha it is now one language," surely you could just compile and link the C code with libzigc... In my opinion, it's not worth translating code if the benefit of "hey look one language" requires the cost of "let's pray the LLM didn't hallucinate or make a mistake while translating the code."
I think we either need to make operating systems not in C, or just accept that at some level we rely on C.
https://www.kptv.com/2026/01/31/live-labor-unions-rally-marc...
This isn't some hypothetical political agenda I'm using my platform to push. There's a nonzero chance I go out there next weekend to peacefully protest, and get shot like Alex Pretti.
Needless to say, if I get shot by ICE, it's not good for the Zig project. And they've brought the battle to my doorstep, almost literally.
Abolish ICE.
/s
The same goes for TLA+ and all the other obscure things people think would be great to use with LLMs, and they would, if there was as much training data as there was for JavaScript and Python.