10 comments

  • Waterluvian41 days ago
    Any sense how, if at all, C++ Immer and JS Immer relate as projects? They’re basically meant to be the same thing but I haven’t found either acknowledging the other.
    • acemarke41 days ago
      Completely unrelated.<p>- Immer (C++) appears to be roughly equivalent to Immutable.js ( <a href="https:&#x2F;&#x2F;immutable-js.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;immutable-js.com&#x2F;</a> ): a set of specialized data structures<p>- 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<p>As far as I know, Michel Weststrate came up with the name independently (although I can&#x27;t 100% confirm that).<p>(source: I didn&#x27;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&#x27;m a secondary maintainer at this point.)
      • benoits41 days ago
        Thanks for your work, really appreciated the RTK perf boost!
    • eru41 days ago
      &#x27;Immer&#x27; is just German for &#x27;always&#x27; or &#x27;eternal&#x27;. So giving that name to your library of persistent and immutable data structures is a fairly natural thing to do, without them having anything more in common than that.<p>(Of course, they might have more in common, I don&#x27;t know.)
      • MeteorMarc41 days ago
        Immer is also a dutch word, with the same meaning as in german.
      • Hendrikto40 days ago
        I would never translate “eternal” to “immer”, but rather “ewig”. “Always” is the corrent translation, imo.
        • eru40 days ago
          Sure, though &#x27;never&#x27; is a bit of a strong statement. It depends on context and what&#x27;s idiomatic.<p>An example:<p>DE: Er schwor, ihr auf immer treu zu sein.<p>EN: He swore to be eternally faithful to her.
          • Hendrikto36 days ago
            True, that works, but I still think “Er schwor, ihr ewig treu zu sein.” is the more natural translation.
  • gnabgib47 days ago
    Popular in:<p>2019 (102 points, 56 comments) <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=20947222">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=20947222</a><p>2016 (144 points, 46 comments) <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=13049843">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=13049843</a>
  • naruhodo41 days ago
    For the curious, yes they provide a garbage-collected heap [1] as well as reference counting.<p>[1] <a href="https:&#x2F;&#x2F;sinusoid.es&#x2F;immer&#x2F;memory.html#classimmer_1_1gc__heap" rel="nofollow">https:&#x2F;&#x2F;sinusoid.es&#x2F;immer&#x2F;memory.html#classimmer_1_1gc__heap</a>
  • bjoli40 days ago
    Cool! I just implemented RBB trees for c#. Not on this level, mostly just for fun. I am not a programmer at all, but I do like myself a neat data structure.<p>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))<p><a href="https:&#x2F;&#x2F;github.com&#x2F;bjoli&#x2F;RrbList&#x2F;tree&#x2F;main&#x2F;src&#x2F;Collections" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;bjoli&#x2F;RrbList&#x2F;tree&#x2F;main&#x2F;src&#x2F;Collections</a><p>Another thing I havent figured out is how to setup docfx to just pull my XML comments and generate API documentation.
  • gignico41 days ago
    I used this library extensively in a prototype of a project and it was awesome!<p>Besides performance, the API is very well thought.
  • actionfromafar40 days ago
    This library always makes me feel small - as in, I wish I did the cool things which call for such solutions. :)
  • dacapoday39 days ago
    I just tried building some immutable data structures in Go: (<a href="https:&#x2F;&#x2F;github.com&#x2F;dacapoday&#x2F;smol" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;dacapoday&#x2F;smol</a>) a kv store base on cow b+ tree
    • dacapoday39 days ago
      In-memory immuatable data structures seem to be only suitable for scenarios with large amounts of data and high concurrency. In most scenarios, this actually incurs a lot of additional copying overhead.
  • nurettin41 days ago
    Anyone else religiously went through 490 packages in cppget to make sure they aren&#x27;t missing out?
  • asa41 days ago
    Good stuff. Very good stuff.
  • alexpadula40 days ago
    Really cool!