I have a Paralella board, which is basically an ARM machine running Ubuntu plus a separate 16 core Epiphany chip, so in essence two platforms, both programmable in C. To run code on the Epiphany cores you write this code in C and compile it with a special GCC-derived compiler. Additionally you have to write the main controlling code for the ARM host, which is compiled with standard GCC for ARM. I managed to compile and test Nim on the ARM host, so I should be able to write the controlling code in Nim and compile it with Nim to working object code. The part I am not sure about is using Nim to program for the Epiphany chip, as this requires using the special C compiler. It would be nice if I could somehow tell the Nim compiler to use this special 'e-gcc' compiler when compiling C sources for the Epiphany chip. So, have Nim generate the C sources, but then having e-gcc do the next step. Assuming the Nim cannot be configured to do that, my question is: is there a way to tell the Nim compiler to only perform the first compilation step (Nim to C) and skip the second step? 2017-10-08 15:51:42

Passing -c to the nim compiler will force nim to only output the C files and not try to compile them. It places resulting c files in a directory called "nimcache", inside your project directory by default.

This has been talked about several places, though it's not as prominent as it could be in the docs.

--os:standalone may also be useful for the code that runs on the micro controller. @see: https://nim-lang.org/docs/nimc.html#nim-for-embedded-systems

That Nim Compiler guide is probably going to be very useful to you in general: https://nim-lang.org/docs/nimc.html

2017-10-09 18:31:44
I think what you want is to define a new compiler executable. Look for nim.cfg for how to define it for chosen compiler. Or read this last item at faq, https://nim-lang.org/faq.html
2017-10-09 18:35:51


though it's not as prominent as it could be in the docs

Improvement is only a PR away

You were volunteering to improve this, right?

2017-10-09 22:05:57



It wouldn't be my first one


Any suggestions on a good place to put these improvements?

Maybe a new section at the bottom of the Nim compiler guide?

2017-10-09 23:18:57

What about in Nim Backend Integration ?

The Backend stuff is part of the Nim Compiler User Guide

2017-10-10 00:56:16
@jlp765, Backend Integration is a good idea! I will try there. 2017-10-10 18:21:35