Nim has released version 2.0 of its programming language, which focuses on solving system programming problems. The language uses static typification and takes inspiration from Pascal, C++, Python, and Lisp. Nim source code can be compiled into representations in C, C++, Objective-C, or JavaScript. The resulting C/C++ code can then be compiled into an executable using compilers such as Clang, GCC, ICC, or Visual C++, allowing for high productivity. However, the costs of garbage collection should be taken into account. Similar to Python, Nim uses indents as dividers of blocks and supports metaprograms and the creation of subject-oriented languages (DSL). The project code is available on GitHub under the MIT license.
Some of the changes in the new version of Nim include:
- By default, the ORC garbage collector is now used. It uses the same algorithm for calculating links to objects as the arc collector and additionally supports the cycles processor, enabling the use of ARC to implement the ASYNC mechanism in the standard library.
- Improved error handling and added the possibility of nested unpacking.
- Added the ability to infer descending output of types.
- Introduced pragma .forbids to determine prohibited tags.
- The OS module in the Standard Library has been divided into several separate modules for improved organization.
- Stabilized support for overload of transferred types (enum).
- Objects now have the ability to determine default field values.
- Improved compatibility with C++ code.