3 ms·
> I'm pretty sure I can implement any imaginable algorithm without mutation. We know this from the equivalence of Universal Turing Machines (which mutate a tap
by kazinator 12y ago
> I'm pretty sure I can implement any imaginable algorithm without mutation.
We know this from the equivalence of Universal Turing Machines (which mutate a tape) and partial recursive functions (application of operations to immutable values).
Any mutation is a functional mapping from the total previous state to the total new state.
Of course, you generally don't want your ethernet driver to clone the entire OS just because it has another packet to add to a queue.
Mutation can be tremendously resource-saving, when you don't need the previous state. The problems occur when parts of the software develop nostalgia for the way things were before the mutation. :)