No-Libc Zig Now Outperforms Glibc Zig
ziglang.org
ziglang.org
I've been testing on Linux 6.12.3 AMD Ryzen 9 7950X 16-Core Processor, against this glibc:
libc.so.6 => /nix/store/nqb2ns2d1lahnd5ncwmn6k84qfd7vx2k-glibc-2.40-36/lib/libc.so.6 (0x00007fb4dbd62000)
Some things I think are remarkable:
Contrary to Rust, zig allows to cross-compile to MacOS. I think this implies that zig needed to build a custom linker!
Regarding libc:
- On Linux libc is not required because zig is using syscalls directly - On MacOS libc is required because of the lack of stable abi - On Windows libc is not required because zig links to windows kernel dll.
To my understanding, this implies that a compiled zig program will work across all linux distributions!
For C integration, I'm not knowledgeable enough to fully appreciate the work being done. but the fact that the cross-compiling also works out-of-box is mind-blowing to me.
I wish they took the time to communicate the intricacies of their toolchain.
Some things I think are remarkable:
Contrary to Rust, zig allows to cross-compile to MacOS. I think this implies that zig needed to build a custom linker!
Regarding libc:
- On Linux libc is not required because zig is using syscalls directly
- On MacOS libc is required because of the lack of stable abi
- On Windows libc is not required because zig links to windows kernel dll.
To my understanding, this implies that a compiled zig program will work across all linux distributions!
For C integration, I'm not knowledgeable enough to fully appreciate the work being done. but the fact that the cross-compiling also works out-of-box is mind-blowing to me.