4 ms·
having a tough time following this as it seems to require familiarity with the subject already. Anyone able to provide or link to a more introductory version of
by rashkov 9y ago
having a tough time following this as it seems to require familiarity with the subject already. Anyone able to provide or link to a more introductory version of this topic?
- shalabhc 9y agoSeek out other answers on Quora by Alan Kay? Also check out Tea Time from the Croquet project: https://en.wikipedia.org/wiki/Croquet_Project#Synchronization_architecture https://en.wikipedia.org/wiki/Croquet_Project#Synchronizatio... IIUC one idea here is to apply the concept of 'reliable function' into the object oriented world: > For example, this would allow “real objects” to be world-lines of their stable states and they could get to their next stable state in a completely functional manner. So [object_in_state_A + message_Y] => [object_in_state_B] is some change in an object as a result of receiving a message. This 'transformation' is functional i.e. always produces the same result, given the same input state and message (similar to the pure function concept in FP). Also, the transformation 'rules' only see exactly state_A and not some invalid in-between state. This allows reasoning about these transformations clearly. The object is a history of object states: [object_in_state_A -> object_in_state_B -> object_in_state_C] etc. Note only the 'stable' i.e. valid states are exposed by the object (they're unavailable during transformation) so any view is consistent. Now to compose many such objects into larger system that is also consistent, see the Virtual Time idea (David Jefferson) or the earlier Pseudo Time idea (David Reed). An overview of Virtual Time is here: https://blog.acolyer.org/2015/08/20/virtual-time/ https://blog.acolyer.org/2015/08/20/virtual-time/. The rough idea is that all messages are stamped with a virtual timestamp - so any receiver can determine the exact order in which to apply the incoming messages. The whole system moves forward in virtual time, correcting for any out-of-order delivery - the real time of each message isn't important anymore.
- elcritch 9y agoAside from the virtual Time idea, it strikes me as very similar to how Elixir programs work. :-) Well Erlang as well but the Elixir language design encourages maps and typed maps which resemble objects more so. It’d be neat if you could re-wind your entire app with a virtual time (like clojure Scripts debugging setup).
- shalabhc 9y agoRight - Erlang does the 'objects and messaging' idea quite well. I'm not sure if all effects of sending a message to an Erlang process are 'isolated'? E.g. could a process write to the disk directly or would that also be manifested as a message? The result of having a time base universally embedded in all messages and object histories is that there is no 'global' system state. You can only look at the system at a specific snapshot, even while it may continue to evolve.
- elcritch 9y agoYes, actors in BEAM can modify files and there's a small bit of local state which can be set without messages (the process dictionary). However, much like Haskell you'd still need some point where real side effects could occur. It'd be possible to do all file actions via specific actors using messages which could then be modified to support "time-travel".
- shalabhc 9y agoRight - you'd also need object 'histories', so handling every message in effect produces a new version of the process.
- deleted 9y ago[deleted]
- mpfundstein 9y agoThanks a lot for the virtual time article. It was an awesoem read. Do you have any more of those?
- shalabhc 9y agoHmm, not sure what specific aspect you're looking for but here's some related stuff: For 'managed time' ideas in the 'small', see https://www.microsoft.com/en-us/research/publication/programming-with-managed-time/ https://www.microsoft.com/en-us/research/publication/program... and http://www.vpri.org/pdf/tr2011001_final_worlds.pdf http://www.vpri.org/pdf/tr2011001_final_worlds.pdf There seems to be more in database systems with overlapping ideas, e.g. see Datomic (https://www.infoq.com/articles/Datomic-Information-Model https://www.infoq.com/articles/Datomic-Information-Model) and CRDTs (https://en.wikipedia.org/wiki/Conflict-free_replicated_data_type https://en.wikipedia.org/wiki/Conflict-free_replicated_data_...).
- vlthr 9y agoThank you! Fascinating reading.