How to get code from nim program?

I followed documents and compiled using nim compileToC helloworld.nim , but just spat out the executable. How can I see the intermediate view of C?

+7
source share
3 answers

nim -c -d:release c helloworld.nim simply creates C files in nimcache without compiling or linking them. -d:release makes reading code easier.

+9
source

Solved: when you compile the nim program, the nimcache directory nimcache automatically created in the same directory that contains the c code.

+3
source

Update 2019 (Nim 0.19.2)

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

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

See the related nim compiler documentation article for details.

0
source

Source: https://habr.com/ru/post/986260/


All Articles