The Nim team has released version 2.0 of the Nim programming language, described as evolutionary, now with ORC (cyclic reference counting) as the default for memory management.
When ORC was introduced, Nim designer Andreas Rumpf compared ORC to a mark and sweep garbage collector and said that: “ORC always wins on latency and memory consumption; plays nice with destructors, and hence with custom memory management; is independent of the heap sizes; tracks stack roots precisely and works cleanly with all sanitizers the C/C++ ecosystem offers.”
A new experimental switch called strictDefs enforces that a variable has been assigned a value before it can be used. “We found Nim’s default initialization rule to be one major source of bugs,” said the Nim team, introducing version 2.0.
In the Nim forum Rumpf said that his favourite new feature was overloadable enums. He also apologized for not yet completing incremental compilation, which has the potential to improve compile time. “Bugs aside, the way we implemented IC doesn’t show enough of a performance benefit so we’ll redo the way it works yet again. Sorry,” he said.
Another advantage of Nim is that it relatively easy to learn. The language “borrows heavily from (in order of impact): Modula 3, Delphi, Ada, C++, Python, Lisp, Oberon,” says the FAQ.
A developer on Hacker News, who uses Nim in production, said: “It’s been a real joy to work with and reminds me of when I discovered D back in the day, only it’s even better. If you imagine native-compiled type-annotated Python where nearly 100% of your code is business logic with no cruft, you’re getting close to the Nim experience.”