2 ms·
zig distributes critical stuff like C library headers and libs. So it's not smarter, just more convenient. Built in support for several OS/architecture combos
by wyldfire 5y ago
zig distributes critical stuff like C library headers and libs. So it's not smarter, just more convenient. Built in support for several OS/architecture combos.
- notaplumber 5y agoAlthough as mentioned in the article, this won't work on systems like *BSD, Solaris or macOS.
- kubkon 5y agoOne tiny correction that we do support seamless C/C++ cross-compilation to macOS now with the advent of our own in-house linker `zig ld`. :-)
- azakai 5y agoIn addition, zig cc uses a remarkable compile+cache mechanism, which makes it possible to distribute a single build that can be used to cross-compile anything. It will cross-compile the necessary files as you need them, transparently - without downloading a new toolchain for each target, and quickly. zig cc is really, really cool, and it's incredibly generous that it provides zig's benefits to users of C and C++ as well.
- jlarocco 5y agoWhen you put it that way, this is an unfair comparison and the downsides are more obvious. With GCC and Clang, I only pay for cross compilation if I need it, so for a fair comparison, the cross-compiler libraries should be installed for GCC and Clang. Also with GCC and Clang, I don't have to worry about a third party (the Zig team) incorporating bug and security fixes from upstream. And with GCC I get support for more platforms. If I have chosen to use cross-compilation, building for alternative architectures is just as easy as for Zig.