3 ms·
Strongly disagree. You can do radically less copying when GC is available. Yes, the graph needs to be traced eventually, but we know how to make GC fairly fast,
by barrkel 9y ago
Strongly disagree. You can do radically less copying when GC is available. Yes, the graph needs to be traced eventually, but we know how to make GC fairly fast, especially if we can afford more memory.
- seanmcdirmid 9y agoNobody really does that and it has serious multi threading problems. All the tricks to avoid copying are fragile in some way.
- pmarreck 9y agoI think you need to study how the BEAM VM works with immutable data and GC in order to revise your opinion a bit, here
- seanmcdirmid 9y agoIsn't Erlang single threaded (i.e. no shared memory between threads)?
- hellofunk 9y agoYou really should read up on the implementation of FP data structures in languages like Clojure or Haskell before making statements like this. You sound silly. Clojure's immutable data structures are thread-safe, fast, and quite different than your apparent idea of what these kinds of data structures actually are.
- barrkel 9y agoA major benefit of immutable data is worry-free sharing, and it's how you make persistent data structures fast. You simply can't afford to copy the whole world on every update. There are some performance implications with NUMA, but there aren't serious multi-threading problems with immutable structures. Immutability means there isn't anything to race with, as long as initial construction is retired properly before other threads see anything, which is a compiler / runtime implementation problem, not an end user programmer problem.