Sunday, July 6, 2008

Actor and Object Models

Please bear with my ignorance with concurrency models, but I am very new to this. So, I am just reading up on the actor model, which I believe both Erlang and Scala are based on. According to Wikipedia --

"The Actor model adopts the philosophy that everything is an actor. This is similar to the everything is an object philosophy used by some object-oriented programming languages, but differs in that object-oriented software is typically executed sequentially, while the Actor model is inherently concurrent."

I did not think that there was any such limitation of the object model paradigm.

Is this correct?

2 comments:

Paul said...

Hi Andrew,

I don't think Scala is "based on the actor model". Scala is a bit of a hybrid mixing functional ideas with OO and procedural programming. The actor idea started off in Smalltalk I believe and can be viewed as a more general form of the OO idea.

Alan Kay came from a biology background and had the idea of viewing software abstractions as loosely coupled cells with a membrane that encapsulates the insides. These cells can only communicate with each other through messages.

So actors are cells with their own cpu and memory (share nothing)which talk to each other only through messages. If you restrict the actor model to use synchronous messaging where the sender waits for an answer from the receiver before continuing, then you only need one cpu (thread), and you have OO as we know it today. So OO is a restricted form of the Actor model.

Scala and a number of other languages including Ruby have added Actor capabilities through the use of a library. Erlang is different because asynchronous messaging and concurrency is built straight into the base language. So the actor model is part of the language.

There are a number of papers out there, OOPSLA is a good source but I think you need an account with ACM.

Google around and you should find stuff.

Brad Wiederholt said...

I wish I could contribute, but I'm having too many deja vu flashbacks to the 80's where a whole lot of these ideas were floating around but seems like either I've forgotten about a lot of them, or they were suppressed by the 'winning' OO ideas. I need to do a bit of reflection and remembrance cause it seems like we are coming back to that point on the circle...