tldr/pages/common/nim.md

30 lines
703 B
Markdown
Raw Normal View History

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