4 ms·
You mention that one of the benefits would be that memory can be shared across processes without any defensive copying or protection semantics, but isn't the en
by mostly_harmless 13y ago
You mention that one of the benefits would be that memory can be shared across processes without any defensive copying or protection semantics, but isn't the entire idea that immutable values are a special type of defensive copying and protection semantic?
I imagine that this would be useful if doing many calculations on readonly values, but would take a performance hit for readwrite operations.
I'm not one for purely functional programming, but this seems like an interesting concept. I'm interested to see where it goes
- augustl 13y agoInteresting definition of immutable values, and a valid one. My perspective is different. An immutable value has a value add more than that of avoiding defensive copying, such as structural sharing. When you add a key to an immutable map, the new map can point to the old. It has become more and more common to model systems with append-only as the only form of write (Event Store, Datomic), so readwrite can probably be avoided in some cases. And things like IP packets certainly makes sense to represent immutably - anything else is a bit of a lie :) But there is certainly a risk that the trafeoff of immutabulity becomes too costly for an OS.. Also, the system language will not be pure, like Haskell. Just immutable values, like Clojure :)