8 ms·
Since you seem to know how this works -- I hope you won't mind if I ask you a slightly on-topic question about this... I've been trying to find out if I can ta
by daemon_beard 7y ago
Since you seem to know how this works -- I hope you won't mind if I ask you a slightly on-topic question about this...
I've been trying to find out if I can take the generated C code that nim produces and, for example, compile it on some exotic architecture (say an ancient solaris/sparc system or some aix/power thing, or some mips microcontroller with linux) however I can't find any examples of people doing this...
Is it possible? Or should I abandon hope and continue writing C for these platforms? :}
- PMunch 7y agoAs the others have said it should be possible. Nim is already pretty good at cross-compiling, but it is also able to just spit out the C files it generates and allow you to play with those.
- tokai 7y agoYeah you can get to the generated C. See this SO question.[0] Give it a try :) [0]https://stackoverflow.com/questions/29956898/how-do-i-get-the-c-code-of-a-nim-program https://stackoverflow.com/questions/29956898/how-do-i-get-th...
- Tiberium 7y agoAre you sure your OS/CPU is not on this list? :) https://github.com/nim-lang/Nim/blob/devel/lib/system/platforms.nim https://github.com/nim-lang/Nim/blob/devel/lib/system/platfo... And yes, compiler works on almost all of them (you can see which ones are precompiled in csources - https://github.com/nim-lang/csources/blob/master/build.sh#L76 https://github.com/nim-lang/csources/blob/master/build.sh#L7... ) And for CPUs - https://github.com/nim-lang/csources/blob/master/build.sh#L132 https://github.com/nim-lang/csources/blob/master/build.sh#L1...
- nimmer 7y agoYes, Nim can run on all sorts of architectures including AVR microcontrollers, MIPS, RISC-V.