Hi there.
Generated C Nim code usually targets specific a specific OS and CPU combination with it's C gen backend.
But the tarball for Nim itself (also written in Nim), is cross-platform, and doesn't require a specific CPU or OS to be present.
Is there a way to tell the Nim compiler to output cross-platform C, in a similar sense to how Nim itself is distributed as a single tarball?
Have been trying for a while but haven't yet been able to get niminst working for me :-) (I'll keep trying to figure it out later)
But I think the secret is actually over here during the process of installing Nim from github:
git clone --depth 1 https://github.com/nim-lang/csources.git
Over there is c source code - generated by nim, for an earlier version of the Nim compiler.
And that C source code comes in basically a huge number of permutations of OS and Architecture.
Basically, 10 OS for 10 CPUs would contain 100 sets of C source code, that get bundled up over in csources.git
So basically, the trick is to just compile your nim project for all the combinations of OS and CPU that you want to target :P.
I thought there might be something like a single set of canonical source code, with a huge number of #ifdefs or something, but I guess this way works better for Nim and the codegen backends :-)
Cool!