1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-04-29 23:24:55 +02:00
tldr/pages/common/nim.md

30 lines
777 B
Markdown
Raw Normal View History

2018-07-21 18:56:19 +02:00
# nim
> The Nim compiler.
> Processes, compiles and links Nim language source files.
2022-10-26 21:00:57 +11:00
> More information: <https://nim-lang.org/docs/nimc.html>.
2018-07-21 18:56:19 +02:00
- Compile a source file:
`nim {{[c|compile]}} {{path/to/file.nim}}`
2018-07-21 18:56:19 +02:00
- Compile and run a source file:
`nim {{[c|compile]}} {{[-r|--run]}} {{path/to/file.nim}}`
2018-07-21 18:56:19 +02:00
- Compile a source file with release optimizations enabled:
`nim {{[c|compile]}} {{[-d|--define]}}:release {{path/to/file.nim}}`
2018-07-21 18:56:19 +02:00
- Build a release binary optimized for low file size:
`nim {{[c|compile]}} {{[-d|--define]}}:release --opt:size {{path/to/file.nim}}`
2018-07-21 18:56:19 +02:00
- Generate HTML documentation for a module (output will be placed in the current directory):
2022-10-26 21:00:57 +11:00
`nim doc {{path/to/file.nim}}`
- Check a file for syntax and semantics:
`nim check {{path/to/file.nim}}`