3 ms·
‘zig cc’ is more than that. You get a very powerful caching system, and built in support for cross compilation to a huge range of targets (via zig shipping wit
by williamstein 5y ago
‘zig cc’ is more than that. You get a very powerful caching system, and built in support for cross compilation to a huge range of targets (via zig shipping with libc sources). Zig is extremely impressive.
- dleslie 5y agoThe built in cross compilation is just LLVM; it's a narrower set of targets than GCC, and a _far_ narrower set of targets than where you'll find a C compiler. clang cross compilation is not really any harder, you just supply the -target flag.
- messe 5y ago> clang cross compilation is not really any harder, you just supply the -target flag. Yes, but it doesn't bundle and automatically compile the appropriate C library for the platform. Zig does.
- dleslie 5y agoIt can, if the package manager bundles it that way. Instead, clang is usually packaged and distributed as cross-compilation variants; because most of the time users don't need all of the different possible targets, they just want one or two.
- klyrs 5y agoThe benefit here is that zig is batteries-included. The fact that you can drive to the store and buy batteries if you need them is missing the point.
- AndyKelley 5y agoHere's some relevant reading [1]: > If zig cc is built on top of Clang, why doesn't Clang just do this? What exactly is Zig doing on top of Clang to make this work? > The answer is, a lot, actually. I'll go over how it works here. [1]: https://andrewkelley.me/post/zig-cc-powerful-drop-in-replacement-gcc-clang.html https://andrewkelley.me/post/zig-cc-powerful-drop-in-replace...