3 ms·
The Zig compiler bundles the SDKs of supported targets while Clang does not, so you can cross compile out of the box without any extra steps. It also defines ta
by throwaway2046 3y ago
The Zig compiler bundles the SDKs of supported targets while Clang does not, so you can cross compile out of the box without any extra steps. It also defines targets for various GLIBC versions which AFAICT Clang does not.
- pjmlp 3y agoIt is so hard to install additional OS packages.
- flohofwoe 3y agoDid you actually try it? Across Windows, Linux and macOS? Setting up a vanilla Clang toolchain for cross-compilation is by far not as trivial as you make it sound.
- pjmlp 3y agoYou mean like cross compiling from Windows to Symbian, Windows CE/Pocket PC, Palm, Android, PlayStation, Nintendo, XBox? It is not a walk in the park, but it hardly a task only worthy of Hercules.
- IshKebab 3y agoNobody said it was a task only worthy of Hercules. Just that it is a royal pain, and Zig removes that pain. You asked "why zig?". That's your answer.
- flohofwoe 3y agoAnd then did you try the same on Linux and macOS? That's what the Zig toolchain gives you, it doesn't lock you into a specific OS.
- txdv 3y agoYeah, and zig solves that. Instead of installing, trying the right header files, you just untar 70mb and you are good to go.