Re:How Class-based Programming Sucks (2011)
by theseoafs on Friday December 13, 2013 @07:24AM
(#6900174)
I'm sorry, are you arguing that immutability models the world more well than OO because no object in the real world ever stays the same?
[ Parent
| on HN ]
Yes. Due to Special Relativity, different observers perceive events (changes to object state) at different moments, the state of the whole universe is not consistent. Therefore, we model the universe using a sequence of immutable universe snapshots, with different computational agents independently moving through the (branching) timeline of snapshots, so that each and every one of them views the universe consistently.
Re:How Class-based Programming Sucks (2011)
by pmahoney on Friday December 13, 2013 @08:35AM
(#6900371)
Most events humans care about happen in plain old classical physics, and no computer is moving at some large fraction of light-speed relative to any other computer. If you maintain synchronized clocks, everyone can agree on the exact same order of events (which would not be true in a relativistic situation).
Now it turns out to be difficult to maintain synchronized clocks, and Lamport timestamps and vector clocks are alternatives. The end result looks similar to a relativistic situation, but (and I'm not a physicist), it seems wrong to claim this situation is because of Special Relativity.
Thoughts?
Yes. I was half joking, half explaining why immutability actually is better to model the universe.
In practice, replace Special Relativity with Network Problems.
Re:How Class-based Programming Sucks (2011)
by eloff on Friday December 13, 2013 @09:32AM
(#6900623)
So what you're saying is the universe is mapped COW, and everytime there's a new observer, UniverseOS runs it with fork().
Re:How Class-based Programming Sucks (2011)
by evanspa on Friday December 13, 2013 @09:21AM
(#6900562)
Check out the first 20 minutes or so of this SICP lecture. In it, Abelson specifically mentions special relativity as a way for us humans to "model" the real world as immutable values over the continuum of time (in contrast to a mutable world that fits with OO).
http://ocw.mit.edu/courses/electrical-engineering-and-comput...
Re:How Class-based Programming Sucks (2011)
by SamReidHughes on Friday December 13, 2013 @07:28AM
(#6900182)
No need to apologize. With immutability you have to explicitly model temporal changes.
Re:How Class-based Programming Sucks (2011)
by dustingetz on Friday December 13, 2013 @05:44PM
(#6903324)
Immutable doesn't mean unchanging. It means no mutation. I can throw a ball in the air and model it as a function of time without mutation.