Re:Alan Kay's: Why is FP seen as the opposite of OOP rather ...
by elcritch on Friday March 23, 2018 @04:03AM
(#16655964)
Aside 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).
[ Parent
| on HN ]
Re:Alan Kay's: Why is FP seen as the opposite of OOP rather ...
by shalabhc on Friday March 23, 2018 @12:48PM
(#16660010)
Right - 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.
Re:Alan Kay's: Why is FP seen as the opposite of OOP rather ...
by elcritch on Monday March 26, 2018 @02:03AM
(#16676951)
Yes, 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".