How do I get the c code of a nim program?

nim -c -d:release c helloworld.nim just creates the C files in nimcache, without compiling and linking them. -d:release makes the code easier to read.


Solved: When you compile a nim program a nimcache directory is automatically generated in the same directory that contains the c code.


2019 Update (Nim 0.19.2)

The default nimcache directory has changed from the current working directory to:

  • $HOME/.cache/nim/<project_name> for Linux and MacOS
  • $HOME/nimcache/<project_name> for Windows

See the relevant nim compiler documentation article for details.

Tags:

Gcc

Nim Lang