# Nim version 2.4.0 released

DevFeed: [Nim version 2.4.0 released](<https://devfeed.tech/articles/nim-version-2-4-0-released-105423.md>)

Original publisher: [Read original article](<https://nim-lang.org//blog/2026/10/28/nim-240.html>)

Published: 2026-10-28T00:00:00Z

Content type: release

Language: en

Sources: [Nim Programming Language](<https://devfeed.tech/sources/nim-programming-language.md>)

Topics: [Nim](<https://devfeed.tech/topics/nim.md>), [version](<https://devfeed.tech/topics/version.md>), [builds](<https://devfeed.tech/topics/builds.md>)

Tags: [algorithm](<https://devfeed.tech/tags/algorithm.md>), [api](<https://devfeed.tech/tags/api.md>), [convenient](<https://devfeed.tech/tags/convenient.md>), [cycles](<https://devfeed.tech/tags/cycles.md>), [dependencies](<https://devfeed.tech/tags/dependencies.md>), [efficiency](<https://devfeed.tech/tags/efficiency.md>), [features](<https://devfeed.tech/tags/features.md>), [incremental](<https://devfeed.tech/tags/incremental.md>), [low-level](<https://devfeed.tech/tags/low-level.md>), [new-features](<https://devfeed.tech/tags/new-features.md>), [nim](<https://devfeed.tech/tags/nim.md>), [optimization](<https://devfeed.tech/tags/optimization.md>), [parallel](<https://devfeed.tech/tags/parallel.md>), [porting](<https://devfeed.tech/tags/porting.md>), [rebuilds](<https://devfeed.tech/tags/rebuilds.md>), [release](<https://devfeed.tech/tags/release.md>), [release-highlights](<https://devfeed.tech/tags/release-highlights.md>), [small](<https://devfeed.tech/tags/small.md>), [sso](<https://devfeed.tech/tags/sso.md>), [version](<https://devfeed.tech/tags/version.md>)

## AI overview

Nim 2.4.0 adds SSO strings, parallel incremental compilation, thread-safe cycle collection, concise sum types, and explicitly declared cyclic imports. SSO requires porting raw string pointer access to intent-specific helpers such as `readRawData` and `beginStore`/`endStore`; this API works across string backends, though SSO may not improve every program. Incremental compilation uses multiprocessing, and compile-time macros that rely on global state may need changes. YRC supports cycles shared across threads with ORC's API, at a reported cost of about twice the runtime and memory in `orcbench`. Sum types remove the explicit discriminator declaration and restrict field access through pattern matching. Cyclic imports use `{.cyclic.}` to enable phase-by-phase checking. The release also describes experimental `owned` references, which require `--experimental:ownedRefs` and may change incompatibly. Nim 2.2.14 is available for users who want to stay on that series.

## Source excerpt

The Nim Team is happy to announce version 2.4.0, our new stable release. After a way-too-long period of development, Nim 2.4 has finally become a reality. This is a major update shipping major new features: --strings:sso for improved string processing efficiency. --ic:on for parallel, incremental rebuilds. --mm:yrc, a new cycle collection algorithm that supports cycles spanning multiple threads. More convenient sum types. Cyclic module dependencies: still not encouraged, but fair game once you declare them with {.cyclic.}. If you're still on Nim 1.6, take a look at the version 2.0 release article to see all the features you're missing. If you've been using Nim 2.0, the version 2.2 release article shows the improvements available in Nim 2.2. If you want to stay on Nim 2.2 for now, we also released version 2.2.14 today, a patch release with many bugfixes and security fixes. Installing Nim 2.4.0 Check out if the package manager of your OS already ships version 2.4.0 or install it as described here. If you have installed a previous version of Nim using choosenim, getting Nim 2.4.0 is as easy as: $ choosenim update self $ choosenim update stable NOTE: We recommend that you install and use the latest version of choosenim, v0.8.16, available in our choosenim repo. Alternatively, you can download Nim 2.4.0 from our nightlies builds. Release highlights Strings based on the small-string optimization (SSO) SSO-based strings come with a new low-level strings API that you have to use in order to use this switch effectively. Nim's new strings API is compatible with Nimony's, so porting is always beneficial, even if --strings:sso might not improve the performance of your code. See it as a worthwhile, future-proof refactoring in its own right. The general idea behind this API is to deprecate the operation addr myString[offset] and to replace it with operations that clarify the intent. Reading is distinguished from writing. Here is our porting guide: Purpose Use Notes Read-only raw