This describes exactly why Erlang scales so well.
This describes exactly why Erlang scales so well.
Erlang with its active objects seems to me to fit precisely his description. Active objects = the objects themselves decide when to run a method = receive a message and react to it.
As opposed to java like oop where the objects just sit there passively and are woken up in a blocking fashion by callers from outside.
It appears to me that c++/java etc. flavour of oop uses objects just as a module system, but then has another module/namespace/package mechanism besides that. Two concepts for the same thing essentially, just making the language unnecessarily complicated.
Plus there are monadic ways of handling concurrency with lwt.
Kay may not have had those things as his primary conception of OOP, but Smalltalk fully supports inheritance, polymorphism and type extension.
Simula 67, one of the first (if not first) OO language way back in 1967 was exactly this also.
A good paper that untangles the terminology is "43 years of actors: a taxonomy of actor models and their key properties".
My understanding of how Erlang is approached in this book is as follows:
- the concurrent declarative/functional computation model has the critical advantage but also limitation of not allowing non-determinism of any sort
- client/server programming without a restricted form of non-determinism is impossible (namely, the server must not need to know from which client the next message will be, which is a form of non-determinism)
- this can be solved by adding a new concept: ports. Ports introduce a restricted form of explicit state, while allowing the rest of the program to be purely functional.
- Erlang is classified as belonging to the computation model that results from adding ports to the concurrent declarative/functional computation model: the Message Passing Concurrent model
- the Object Oriented computation model is different: it is the result of adding explicit state to the (non-concurrent) declarative/functional model. Of course, you can then also add concurrency to the mix. The crucial difference with the Message Passing Concurrent model is that non-determinism is now not restricted to ports anymore, making reasoning about program behaviour way more complicated.
- so, if Smalltalk falls into the concurrent OO computation model, it is both more complex and expressive that Erlang.
He's said exactly this [0]:
> We didn’t even do all of the idea at PARC. Many of Carl Hewitt’s Actors ideas which got sparked by the original Smalltalk were more in the spirit of OOP than the subsequent Smalltalks. Significant parts of Erlang are more like a real OOP language the the current Smalltalk, and certainly the C based languages that have been painted with “OOP paint”.
[0]: https://computinged.wordpress.com/2010/09/11/moti-asks-objec...
Instead, picture an object as a closure over mutable state, where the closure accepts an arbitrary serialized term (the "message") which it can do anything it likes with.
Note how such a "closure object" can call its runtime's timer API to get another message sent to it later. It could even do this in its constructor.
Note also how such a "closure object" can reprogram itself, by holding onto other closures as part of its mutable internal state, and replacing these with other closures [e.g. ones passed in as part of the message] in response to messages.
These two properties together, mean that how a "closure object" responds to a message at a given time, is entirely up to the closure—it can have changed into something that does something entirely different from what its "bootstrap" source code says, at any point since the start of the process. (Just like Joe Armstrong's Erlang "Universal Server" — https://joearms.github.io/published/2013-11-21-My-favorite-e...)