Quoting from https://andrewkelley.me/post/zig-cc-powerful-drop-in-replacement-gcc-clang.html :
For example, maybe you have a programming language that compiles to C. Zig is an obvious choice for what C compiler to ship with your language.
(The link for "programming language that compiles to C" is to nim-lang.org)
The zig tarball is 45MB (!) but that supposedly includes a fully working clang that properly cross compiles to Windows, Mac, Linux, 32-bit, 64-bit, musl, glib, mingw64 and other goodies. Haven't played with this release yet, but everything Andrew Kelley has released so far was working as advertised, so this likely does to.
Useful perhaps, as Andrew suggests, to include in a "batteries included" Nim distribution that can cross-compile from any arch to any arch.
Nice of Andrew Kelley to mention Nim lol. Andrew has come around the Nim irc a few times, with some fun conversations. He is no stranger to the community. :-)
LemonBoy was a prolific Nim contributor before he switched camps for Zig.
There is mutual respect on both sides.
It's not a bad idea in theory.
My biggest issue is embedded, where GCC still rules the land. This isn't zigs fault. LLVM is getting better here, but still has a long way to go to catch up with GCC for supporting the different embedded architectures.
Also, Nim continues to support really old GCC versions (thank you @Araq <3). There is a lot of old infrastructure out there running weird old Unix versions. It is a little bit niche but I think it's a huge selling point that Nim can work in these environments.
I have used Nim on old AIX machines and it saved my sanity lol.
Providing different distributions or just continuing to improve how easy it is to switch backend compilers is the best solution imho.
Agree with @rayman22201. There's many C compilers backends so enabling Zig as a known backend is step one, and there's already a PR. If someone can then setup a CI that bootstraps and tests Nim end to end with Zig as the compiler and fixes any issues, it will be awesome.
A blog post explaining why Nim + Zig plus how to set up and effectively cross-compile would be cool as well.