11 comments

[ 3.2 ms ] story [ 38.3 ms ] thread
I just want to observe libc != glibc there have been and continue to be diverse libc. Maybe I missed if zig on BSD is faster without native non-gnu (possibly less or non-portable) libc. It may well be. They tested on asahi Linux.
Hello! This is my devlog entry.

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)

Massively different syscall api in BSD so probably another mountain of work to do zig independent of bsd libc
I've been looking forward to doing that work, actually. Originally it was my impression that for instance FreeBSD required libc as the stable syscall ABI, however David Chisnall informed me that in fact, the syscall ABI is stable! That's great news as far as I'm concerned because it's quite handy for cross-compilation and static executable distribution.
Great! Have fun, blog it. Would love to read.
(comment deleted)
I wish rust took inspiration.. Same story regarding moving away from llvm.
Assuming you mean something other that the gccrs project (and similar initiatives), why would Rust want to abandon llvm?
This is great. It really showcases zig's dedication to quality, IMO. 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.

I don't know why my comment was duplicated. My appology.
This is great. It really showcases zig's dedication to quality, IMO.

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.