Re: "If you need an embedded C compiler" - from the latest zig blog includes an suggestion for Nim
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.
Re: "If you need an embedded C compiler" - from the latest zig blog includes an suggestion for Nim
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.
Re: "If you need an embedded C compiler" - from the latest zig blog includes an suggestion for Nim
Yep, Andrew pinged me on IRC to suggest Nim adopts this. It might not be a half bad idea, we can pretty easily add it to choosenim for example to make cross-compilation much easier.
Re: "If you need an embedded C compiler" - from the latest zig blog includes an suggestion for Nim
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](https://github.com/LemonBoy) was a prolific Nim contributor before he switched camps for Zig. There is mutual respect on both sides.
Re: "If you need an embedded C compiler" - from the latest zig blog includes an suggestion for Nim
As far as I know it doesn't really cross compile to Mac OSX, but yes, Linux and Windows targets seems to be well supported. One could also try musl.cc cross compilers, if cross compilation to different Windows and Linux targets needed.
"If you need an embedded C compiler" - from the latest zig blog includes an suggestion for Nim
Quoting from [https://andrewkelley.me/post/zig-cc-powerful-drop-in-replacement-gcc-clang.html](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.