17

I was reading this article:

http://www.doc.ic.ac.uk/~nd/surprise_97/journal/vol2/pjm2/

And it mentions that:

...in the actor model even an integer is represented as an actor...

Wikipedia confirms:

The Actor model adopts the philosophy that everything is an actor.

Erlang has many data types and those types are not actors as far as I can tell.

Doesn't it mean that Erlang is not an actor model language in a way some people say that e.g. Java is not a functional language just because it lacks certain functional programming features?

PS: by extension it means that Akka is definitely not an actor model because in addition to non-actor data types coming from the host language it even allows inheriting actors to extend their behavior via host language facilities.

37

Although the Actor Model is older than Erlang, the designers of Erlang only learned about the Actor Model after having designed Erlang, so some differences are to be expected.

They followed parallel paths of evolution, though: the Actor Model was created by Carl Hewitt based on the message passing semantics of Smalltalk. Alan Kay, in turn had based the message passing semantics of Smalltalk on the goal-driven evaluation of PLANNER, which was designed by … Carl Hewitt.

PLANNER was the precursor to Prolog. Erlang was originally not intended to be a language, rather it started out as a library for fault-tolerant distributed programming in Prolog, and later evolved into a dialect of Prolog, before it became its own language, still to this day heavily influenced by Prolog (plus, the original Erlang interpreter was written in Prolog).

So, the similarities between Processes in Erlang, Objects in OO, and Actors in the Actor Model are far from coincidental.

Erlang is a language with several layers, each of which are supersets of the lower layers. The smallest layer is Functional Erlang. This is a standard functional language with some additions inherited from Prolog, such as unification instead of binding/equality. If we add Processes and Messages to that, we get Concurrent Erlang. Throw in remote processes, and you get Distributed Erlang. Now add some libraries and design patterns from the OTP, and you have fault-tolerant Erlang.

Processes are Actors. (They are also Objects.) The inside of Processes is Functional, not Actor-based. The structure of a large fault-tolerant Erlang system constructed using the tools and patterns of the OTP, is often very Object-Oriented.

So, it depends on what scale you are looking at.

In a typical large Erlang system, you have an object-oriented architecture with message-passing actors implemented using functional programming. What OTP calls a server is closely related to an object, servers are made up of processes (which are actors), processes use functions internally.

In general, I don't believe that any pure Actor Language has ever left research. Heck, I don't even know if Carl Hewitt's PLASMA, the original Actor Language was ever even implemented.

  • 4
    Erlang was also designed by people with a problem to solve, and when you're in that position, conceptual purity is often sacrificed at the altar of practicality. – Blrfl Mar 26 '15 at 16:26
  • Interestingly, the problem they were trying to solve (reliability, replication, redundancy, …) is the same nature was trying to solve when it evolved cells. Alan Kay minored in microbiology, and explicitly modeled OO on biological cells. Another parallel. – Jörg W Mittag Mar 26 '15 at 16:30
  • 1
    PLASMA was implemented in MacLisp. It was a rapidly-evolving research language. – Jerry101 May 2 '15 at 4:26
  • 1
    Really enjoyed this answer. Thank you @JörgWMittag! – Felixyz Apr 28 '16 at 9:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.