As I know, Actor model is a theory about concurrency. Erlang and Scala both implement this theory model, but neither of their implementations are totally conform with the Actor model.
From the perspective of computer scientists, what are the differences between the concept "Actor" in Erlang, Scala and that theoretical model?
More specifically, in a Scala actor system, actors interact and share information, without any presupposition of sequentiality. The mechanism by which actors share information with one another, and task one another, is message passing.
The actor is a computational entity that, in response to a message it receives, can concurrently (1) send a finite number of messages to other actors, (2) create a finite number of new actors, and (3) designate the behavior to be used for the next message it receives.
Goroutines are a simple abstraction of Actors. Actors are just a more specific use-case of Goroutines. You could implement Actors using Goroutines by creating the Goroutine aside a Channel. By deciding that the channel is 'owned' by that Goroutine you're saying that only that Goroutine will consume from it.
The actor model can be used as a framework for modeling, understanding, and reasoning about a wide range of concurrent systems. For example: Electronic mail (email) can be modeled as an actor system. Accounts are modeled as actors and email addresses as actor addresses.
I think the biggest difference is the implementation, I am not sure if it qualifies. In Erlang you have few properties:
These are for me the major differences why I think Erlang's actor model is superior to other systems, including Scala.
On the more practical approach, quite often Scala's actor implementation is good enough for the use case. There are few use cases though (maintaining tight latency requirements, for example needing to have the same latency for p99 as p50) where your only option is to use Erlang.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With