Introduced release of the system programming language Nim 2.2.6. The update came six months after the release of version 2.2.4 and includes 141 commits with bug fixes and performance improvements. Nim is a statically typed compiled programming language with Python-inspired syntax and Lisp-level metaprogramming capabilities. The language compiles to C, C++, and JavaScript, delivering C-level performance with the expressiveness of high-level languages. The project code is provided under the MIT license.
Key features of Nim include a powerful system of macros running on AST at compile time, an advanced generalized programming system with concepts, multiple dispatch, deterministic memory management with support for multiple strategies (ARC/ORC, refc, mark-and-sweep), built-in async/await support for asynchronous programming, and FFI for easy integration with C/C++/JavaScript. Nim is positioned as a system language suitable for development from embedded systems to web servers, with an emphasis on efficiency, memory safety and ease of development.
Key changes:
- Optimization of move semantics for object fields. The compiler has learned to recognize the possibility of using move operations when returning object fields. Previously, constructions like “return obj.field” led to copying of data, now the compiler correctly applies movement: proc getField(obj: MyObject): string = return obj.field # Now move instead of copy
This is especially important for heavy data types (strings, sequences, objects with resources), where eliminating unnecessary copying gives a noticeable performance increase without changing the code.
 - Complete redesign of closure iterators with processing exceptions.
The mechanism for transforming iterator closures has been completely rewritten, which has radically improved the stability of async code with exception handling. Fixed critical problems, including SIGSEGV when using try/except not at the top level: iterator problematicIterator(): int {.closure.} = for i in 0..10: try: if i == 5: raise newException(ValueError, “test”) yield i except ValueError: discard # Previously called SIGSEGVAlso solved the problem with incorrect throwing of exceptions in finally blocks inside closure iterators.
 - Fixes related to memory management
- Fixed a fundamental problem in the garbage collector when processing circular data structures, which could lead to an “Illegal storage access” error. The problem has existed since the creation of the language and manifested itself in complex object graphs with mutual references.