Fork me on GitHub

Frequently Asked Questions

General questions

Why yet another programming language?

Nim is one of the very few programmable statically typed languages, and one of the even fewer that produces native binaries that require no runtime or interpreter.

What have been the major influences in the language’s design?

The language borrows heavily from (in order of impact): Modula 3, Delphi, Ada, C++, Python, Lisp, Oberon.

How is Nim licensed?

The Nim compiler and the library are MIT licensed. This means that you can use any license for your own programs developed with Nim.

How stable is Nim?

The compiler and stdlib are actively under development and have a suite of test cases to ensure ongoing stability. Regular releases are posted every three to six months that can be used as a base for projects requiring a stable foundation. Breaking changes are rare but are documented in detail and can typically be managed with minimal effort. The compiler also highlights deprecated features to provide sufficient notice and transition time through changes.

How fast is Nim?

Benchmarks show it to be comparable to C or C++. Nim can be used as a high level language as well as a low level language – always with excellent performance, but some language features are more expensive than others.

What about JVM/CLR backends?

JVM/CLR support is not in the nearest plans. However, since these VMs support FFI to C it should be possible to create native Nim bridges, that transparently generate all the glue code thanks to powerful metaprogramming capabilities of Nim.

What about editor support?

Why is it named proc?

Procedure used to be the common term as opposed to a function which is a mathematical entity that has no side effects. And indeed in Nim func is syntactic sugar for proc {.noSideEffect.}. Naming it def would not make sense because Nim also provides an iterator and a method keyword, whereas def stands for define.

Compilation FAQ

Which option to use for the fastest executable?

For the standard configuration file, -d:release does the trick.

Which option to use for the smallest executable?

For the standard configuration file, -d:quick --opt:size does the trick.

How do I use a different C compiler than the default one?

Edit the config/nim.cfg file. Change the value of the cc variable to one of the following:

Abbreviation C/C++ Compiler
vcc Microsoft’s Visual C++
gcc Gnu C
llvm_gcc LLVM-GCC compiler
icc Intel C compiler
clang Clang compiler
ucc Generic UNIX C compiler

Other C compilers are not officially supported, but might work too.

If your C compiler is not in the above list, try using the generic UNIX C compiler (ucc). If the C compiler needs different command line arguments try the --passc and --passl switches.