Immer – a Library of Persistent and Immutable Data Structures Written in C++
Key topics
The C++ Immer library is making waves with its persistent and immutable data structures, and commenters are raving about its performance and well-designed API. One user even dug into the library's memory management, noting its use of both a garbage-collected heap and reference counting. A debate sparked over the library's name, with some pointing out that "Immer" is German for "always" or "eternal," while another user chimed in that it's also a Dutch word. Meanwhile, a question about the library's relation to a similarly named JavaScript project was quickly resolved, with a commenter clarifying that they're completely unrelated.
Snapshot generated from the HN discussion
Discussion Activity
Active discussionFirst comment
5m
Peak period
14
Day 7
Avg / period
3.8
Based on 19 loaded comments
Key moments
- 01Story posted
Dec 21, 2025 at 3:59 PM EST
12 days ago
Step 01 - 02First comment
Dec 21, 2025 at 4:04 PM EST
5m after posting
Step 02 - 03Peak activity
14 comments in Day 7
Hottest window of the conversation
Step 03 - 04Latest activity
Jan 2, 2026 at 5:38 AM EST
9h ago
Step 04
Generating AI Summary...
Analyzing up to 500 comments to identify key contributors and discussion patterns
Want the full context?
Jump to the original sources
Read the primary article or dive into the live Hacker News thread when you're ready.
- Immer (C++) appears to be roughly equivalent to Immutable.js ( https://immutable-js.com/ ): a set of specialized data structures
- Immer (JS), on the other hand, uses JS Proxies to wrap plain values, traps attempted mutations, and then replays them to return a safely immutable updated final result
As far as I know, Michel Weststrate came up with the name independently (although I can't 100% confirm that).
(source: I didn't create Immer (JS), but I started using it in Redux Toolkit in 2018, am quoted in the docs about how much I love it, spent the last couple months doing performance optimization work that got shipped in Immer 11.x, and just put up some more bugfix PRs today. I'm a secondary maintainer at this point.)
It may or may not be obvious, but Immer is German for "always", and means "forever" in "für Immer". So the name is easy to invent for a library dealing with persistence.
(Of course, they might have more in common, I don't know.)
An example:
DE: Er schwor, ihr auf immer treu zu sein.
EN: He swore to be eternally faithful to her.
I am currently fighting the JIT to understand why a simple flags check (ANDing two bytes and comparing to 0) makes the code 2.5x slower. This is my first c# project so right now I am just throwing things at the compilrr to see what sticks. If anyone knows where I can get help, that would be much appreciated. Dont look too closely on the benchmarks. I managed to make two of them an absolutely best case for ImmutableList (especially SetItem which should degrage linearly with size but now is O(1))
https://github.com/bjoli/RrbList/tree/main/src/Collections
Another thing I havent figured out is how to setup docfx to just pull my XML comments and generate API documentation.
[1] https://sinusoid.es/immer/memory.html#classimmer_1_1gc__heap
2019 (102 points, 56 comments) https://news.ycombinator.com/item?id=20947222
2016 (144 points, 46 comments) https://news.ycombinator.com/item?id=13049843
Besides performance, the API is very well thought.