Nim 2.4.0 Released With Incremental Parallel Builds and New Memory Model
The Nim 2.4.0 release introduces incremental parallel builds, the YRC memory management variant, small-string-optimized strings, and improved sum types.
Nim 2.4.0 arrived on October 28, 2026, alongside patch release 2.2.14. You can enable incremental parallel builds in 2.4.0 with --ic:on, which uses multiple processes rather than threads. For instance, compiling the Nim compiler took 31 seconds with --ic:off and 25 seconds with --ic:on on a 16-core machine.
The release introduces --mm:yrc, a thread-safe variant of ORC that handles cross-thread cycles without a stop-the-world phase or dedicated collector thread. In orcbench tests, YRC runs twice as slow as ORC and uses twice the memory.
You can activate small-string-optimized strings via --strings:sso, which requires adopting a new low-level strings API that deprecates addr myString[offset]. This API separates reading from writing using functions like readRawData and beginStore, maintaining compatibility with Nimony, also referred to as Nim 3.
Sum types now support a compact notation where a case without a discriminator field declares branch names directly. Furthermore, modules can import each other in a cycle if you mark each import with the {.cyclic.} pragma, while unannotated import cycles are deprecated. An experimental owned type modifier also arrives behind --experimental:ownedRefs, though breaking changes are expected.
Choosenim users should run choosenim update self then choosenim update stable, using choosenim v0.8.16.
