<<

Published in ArXiv http://arxiv.org/abs/1008.1459

Actor Model of

Carl Hewitt http://carlhewitt.info

This paper is dedicated to and .

The is a mathematical theory that treats “Actors” as the universal primitives of concurrent digital computation. The model has been used both as a framework for a theoretical understanding of concurrency, and as the theoretical basis for several practical implementations of concurrent systems.

Unlike previous models of computation, the Actor model was inspired by physical laws. It was also influenced by the programming languages Lisp, 67 and -72, as well as ideas for Petri Nets, capability-based systems and . The advent of massive concurrency through client- cloud and many-core computer architectures has galvanized interest in the Actor model.

An Actor is a computational entity that, in response to a message it receives, can concurrently:  send a finite number of messages to other Actors;  create a finite number of new Actors;  designate the behavior to be used for the next message it receives.

There is no assumed order to the above actions and they could be carried out concurrently. In addition two messages sent concurrently can arrive in either order.

Decoupling the sender from communications sent was a fundamental advance of the Actor model enabling asynchronous communication and control structures as patterns of passing messages.

November 7, 2010 Page 1 of 25

Contents Introduction ...... 3 Fundamental concepts ...... 3 Illustrations ...... 3 Modularity thru Direct communication and asynchrony ...... 3 Indeterminacy and Quasi-commutativity ...... 4 Locality and Security ...... 4 Computational Representation Theorem ...... 4 iAdaptiveTM concurrency using ActorScriptTM ...... 5 Other models of message-passing concurrency ..... 5 Historical Background ...... 5 Concurrency versus Turing‟s Model ...... 5 λ-Calculus ...... 6 Petri nets ...... 6 Simula ...... 6 Planner...... 7 Smalltalk-72 ...... 7 Concurrency ...... 8 Actors ...... 8 Actor Semantics ...... 9 ...... 10 Reasoning about Actors ...... 10 Early Actor Programming languages ...... 10 Causal Consistency ...... 10 Extension versus Specialization ...... 12 Early Actor Programming languages ...... 12 Language constructs versus Library APIs ...... 13 Hairy Control Structure Redux ...... 13 Promises ...... 14 Garbage Collection ...... 14 Cosmic Cube ...... 14 J–Machine ...... 15 π-Calculus ...... 15 Was the Actor model premature? ...... 15 Acknowledgment ...... 16 Bibliography ...... 16 End Notes ...... 21

November 7, 2010 Page 2 of 25

i Introduction Illustrations The Actor model is a mathematical The Actor model can be used as a framework for that treats “Actors” as the universal primitives of modeling, understanding, and reasoning about, a wide concurrent digital computation [Hewitt, Bishop, and range of concurrent systems. For example: Steiger 1973; Hewitt 1977]. The model been used both as a  Electronic mail (-mail) can be modeled as an framework for a theoretical understanding of concurrency, Actor system. Accounts are modeled as Actors and as the theoretical basis for several practical and email addresses as Actor addresses. implementations of concurrent systems.  Web Services can be modeled with SOAP endpoints modeled as Actor addresses. Unlike previous models of computation, the Actor model  Objects with locks (e.g. as in Java and #) can be was inspired by physical laws. It was also influenced by modeled as Actors. the programming languages Lisp [McCarthy et. al. 1962], Simula 67 [Dahl and Nygaard 1967] and Smalltalk-72 [Kay 1975], as well as ideas for Petri Nets [Petri 1962], Modularity thru Direct communication and capability-based systems [Dennis and van Horn 1966] and asynchrony packet switching [Baran 1964]. The advent of massive concurrency through client-cloud computing and many- Modularity in the Actor model comes from one-way asynchronous communication. Once a message has been core computer architectures has galvanized interest in the ii Actor model [Hewitt 2009b]. sent, it is the responsibility of the receiver.

Messages in the Actor model are decoupled from the Fundamental concepts sender and are delivered by the system on a best efforts basis. This was a sharp break with previous approaches to An Actor is a computational entity that, in response to a models of concurrent computation in which message message it receives, can concurrently: sending is tightly coupled with the sender and sending a  send a finite number of messages to other Actors; message synchronously transfers it someplace, e.g., to a  create a finite number of new Actors; buffer, queue, mailbox, channel, broker, server, etc. or to  designate the behavior to be used for the next the “ether” or “environment” where it temporarily resides. message it receives. The lack of synchronicity caused a great deal of misunderstanding at the time of the development of the There is no assumed order to the above actions and they Actor model and is still a controversial issue. could be carried out concurrently. In addition two messages sent concurrently can arrive in either order. Because is taken as fundamental in the Actor model, there cannot be any inherent overhead, e.g., Decoupling the sender from communications sent was a any requirement for buffers, pipes, queues, classes, fundamental advance of the Actor model enabling channels, etc. Prior to the Actor model, concurrency was asynchronous communication and control structures as defined in low level machine terms. patterns of passing messages [Hewitt 1977]. It certainly is the case that implementations of the Actor model typically make use of these hardware capabilities. An Actor can only communicate with Actors to which it is However, there is no reason that the model could not be connected. It can directly obtain information only from implemented directly in hardware without exposing any other Actors to which it is directly connected. Connections hardware threads, locks, queues, channels, tasks, etc. Also, can be implemented in a variety of ways: there is no necessary relationship between the number of  direct physical attachment Actors and the number threads, locks, tasks, queues, etc.  memory or disk addresses that might be in use. Implementations of the Actor model  network addresses are free to make use of threads, locks, tasks, queues, global  email addresses assignment, coherent memory, transactional memory, cores, etc. in any way that is compatible with the laws for The Actor model is characterized by inherent concurrency Actors [Baker and Hewitt 1977]. of computation within and among Actors, dynamic creation of Actors, inclusion of Actor addresses in As opposed to the previous approach based on composing messages, and interaction only through direct sequential processes, the Actor model was developed as an asynchronous message passing with no restriction on inherently concurrent model. In the Actor model sequential message arrival order.

November 7, 2010 Page 3 of 25

ordering is a special case that derived from concurrent The security of Actors can be protected in the following computation. ways:  hardwiring in which Actors are physically A natural development of the Actor model was to allow connected Actor addresses in messages. A computation might need to  tagged memory as in Lisp machines, etc. send a message to a recipient from which it would later  virtual machines as in Java , receive a response. The way to do this is to send a Common Language Runtime, etc. communication which has the message along with the  signing and/or encryption of Actors and their address of another Actor called the customer along with addresses the message. The recipient could then cause a response message to be sent to the customer. A delicate point in the Actor model is the ability to synthesize the address of an Actor. In some cases security Of course, any Actor could be used as a customer to can be used to prevent the synthesis of addresses. receive a response message. By using customers, common However, if an Actor address is simply a bit string then control structures such a recursion, co-routines, clearly it can be synthesized given eons of time although it hierarchical parallelism, futures [Baker and Hewitt 1977], can be made unguessable in practice if the bit strings are etc. can be implemented. long enough.

Actors is based on “behavior” as opposed to the “class” concept of object-oriented programming [Dahl and Computational Representation Theorem Nygaard 1967] in which the operations on objects are There is a Computational Representation Theorem in the “inherited” in a hierarchy of classes that is expected to be Actor model for systems which are closed in the sense that shared by the caller and implementation of an operation. they do not receive communications from outside. A closed system is defined to be one which does not communicate with the outside. Actor Indeterminacy and Quasi-commutativity provides the means to characterize all the possible of a closed system in terms of the The Actor model supports indeterminacy because the Computational Representation Theorem [Clinger 1981; arrival order of messages can affect future behavior. Hewitt 2006]: Operations are said to be quasi-commutative to the extent that it doesn‟t matter in which order they occur. To the The denotation DenoteS of a closed system S represents all the possible behaviors of S as extent possible, quasi-commutativity is used to tame i indeterminacy. iii DenoteS = ⊔iN ProgressionS (⊥S)

where ProgressionS is an approximation that Locality and Security takes a set of partial behaviors to their next stage and ⊥S is the initial behavior of S. Another important characteristic of the Actor model is locality. Locality means that in processing a message: an In this way, the behavior of S can be mathematically Actor can send messages only to addresses for which it has characterized in terms of all its possible behaviors.iv information by the following means: 1. that it receives in the message Although DenoteS is not an implementation of S, it can be 2. that it already had before it received the message used to prove a generalization of the Church-Turing- 3. that it creates while processing the message. Rosser-Kleene thesis [Kleene 1943]: Enumeration Theorem: If the primitive Actors of a In the Actor model, there is no simultaneous change in closed Actor System S are effective, then the possible multiple locations. In this way it differs from some other outputs of S are recursively enumerable. models of concurrency, e.g., the model in which Proof: Follows immediately from the tokens are simultaneously removed from multiple locations Representation Theorem. and placed in other locations.

The upshot is that concurrent systems can be represented and characterized by logical deduction but cannot be implemented. Thus, the following practical problem arose:

November 7, 2010 Page 4 of 25

How can practical programming languages be  CLR and extensions (Microsoft) rigorously defined since the proposal by Scott and  JVM (Sun, IBM, Oracle, SAP) Strachey [1971] to define them in terms λ-calculus  LLVM (Apple) failed because the λ-calculus cannot implement  Dalvik (Google) concurrency?v In due course, we will need to extend the above systems with a tagged extension of the

TM TM architecture. Many-core architecture has made a iAdaptive concurrency using ActorScript tagged extension necessary in order to provide the iAdaptive concurrency is the ability to expression following: computations with discretionary activity that can be  concurrent, nonstop, no-pause automatic storage adapted s to fit available resources in terms of demand and reclamation (garbage collection) and relocation available capacity (e.g. cores). to improve efficiency,  prevention of memory corruption that otherwise The ActorScript programming languages has been results from programming languages like C and developed to express iAdaptive concurrency as follows: C++ using thousands of threads in a process,  Universality  nonstop migration of Actors (while they are in o Everything in the language is accomplished using operation) within a computer and between message passing including the very definition of distributed computers the language itself. o Directly express discretionary push and pull Imposing restrictions on threadedness, message order concurrency arrival, and garbage collection (automatic storage o Functional and Logic Programming are integrated management) can greatly diminish the performance and into general concurrent programming. of Actor systems. o Programs do not expose low-level implementation mechanisms such as threads, tasks, locks, cores, vii etc. Messages can be directly communicated Historical Background without requiring indirection through brokers, class The Actor model builds on previous models of hierarchies, channels, mailboxes, pipes, ports, nondeterministic computation. Several models of queues etc. nondeterministic computation were developed including o Program resource control of energy, processing, the following: storage, and communications using sponsors. o Binary XML and JSON are data types Concurrency versus Turing’s Model o Applications cannot directly harm each other. Turing‟s was intensely  Efficiency psychological.viii Sieg [2008] formalized it as follows: o Allow execution to be dynamically adjusted for  Boundedness: A computer can immediately system load and capacity (cores) recognize only a bounded number of o Minimize latency along critical paths configurations.  Locality: A computer can change only ActorScript attempts to achieve the highest level of immediately recognizable configurations. performance, scalability, and expressibility with a In the above, computation is conceived as being carried out minimum of primitives. in a single place by a device that proceeds from one well- defined state to the next. By contrast, in the Actor model [Hewitt, Bishop and Other models of message-passing concurrency Steiger 1973; Hewitt 2010b], computation is conceived as The Actor Model does not have the following restrictions distributed in space where computational devices of other models of message-passing concurrency:vi communicate asynchronously and the entire computation is ix  Single threadedness: There are no restrictions on the not in any well-defined state. Properties of Locality and use of threads in implementations. Local Finiteness hold as follows:  Message delivery order: There no restrictions on  Locality: In response to a message received, an message delivery order. Actor can change only its local storage that can  Independence of sender: The semantics of a message include addresses only of Actors provided when it in the Actor model is independent of the sender. was created and those that it has received in  Lack of garbage collection (automatic storage messages. reclamation): The Actor Model can be used in the following systems:

November 7, 2010 Page 5 of 25

 Local Finiteness: At any point, an Actor has finite However, the semantics of the λ-calculus were expressed storage. In response to a message received, an using variable substitution in which the values of Actor can directly parameters were substituted into the body of an invoked λ o send only a finite number of messages to expression. The substitution model is unsuitable for addresses in the message and its local storage concurrency because it does not allow the capability of o create only a finite number of Actors sharing of changing resources. Inspired by the λ-calculus, Actor systems can perform computations that are the for the Lisp impossible by Turing Machines as illustrated by the [McCarthy et. al. 1962] made use of a data structure called following example: an environment so that the values of parameters did not 1. There is a bound on the size of integer that can be have to be substituted into the body of an invoked computed by an always halting nondeterministic λ-expression. This allowed for sharing of the effects of starting on a blank tape. updating shared data structures but did not provide for 2. By contrast, there are always-halting Actor concurrency. systems with no inputs that can compute an integer of unbounded size. (An Actor can be Scott and Strachey [1971] proposed to develop a created with local storage that is initialized with a mathematical semantics for programming languages based count of 0 that concurrently sends itself both a on the procedural λ-calculus. Milne and Strachey stop and a go message. When it receives a go [1976].continued this work attempting to reduce all message, it increments its count by 1 and sends computation to the λ-calculus. In this work, they invented a itself a go message. When it receives a stop style of sequential programming that was later formalized message, it stops with an unbounded number in using monads [Moggi 1989].xi its local storage.) Another point of departure from Turing’s model is that Petri nets concurrency violates a narrowly conceived “public xii processes” [Hofstadter 1980] criterion for computation. Prior to the development of the Actor model, Petri nets Actor systems make use of hardware devices called were widely used to model nondeterministic computation. arbiters to decide arrival orderings of messages. The However, they were widely acknowledged to have an internal processes of arbiters are not public processes.x important limitation: they modeled control flow but not Instead of observing the internals of arbitration processes, data flow. Consequently they were not readily composable we necessarily await outcomes. thereby limiting their modularity. Hewitt pointed out another difficulty with Petri nets: simultaneous action, i.e., λ-Calculus the atomic step of computation in Petri nets is a transition The λ-calculus was originally developed as part of a in which tokens simultaneously disappear from the input system for the foundations of logic [Church 1932-33]. places of a transition and appear in the output places. The However, the system was soon shown to be inconsistent. physical basis of using a primitive with this kind of Church removed logical propositions from the system simultaneity seemed questionable to him. Despite these leaving a purely procedural λ-calculus [Church 1941]. apparent difficulties, Petri nets continue to be a popular approach to modeling nondeterminism, and are still the The λ-calculus can be viewed as the earliest message subject of active research. passing programming language [Hewitt, Bishop, and Steiger 1973] building on previous work. For example the Simula λ-expression below implements a tree data structure when Simula 1 [Nygaard 1962] pioneered nondeterministic supplied with parameters for a leftSubTree and discrete event simulation using a global clock: rightSubTree. When such a tree is given a parameter In this early version of Simula a system was modeled by message “getLeft”, it returns leftSubTree and likewise a (fixed) number of “stations”, each with a queue of when given the message “getRight" it returns “customers”. The stations were the active parts, and rightSubTree: each was controlled by a program that could “input” a λ(leftSubTree, rightSubTree) customer from the station‟s queue, update variables λ(message) (global, local in station, and local in customer), and if (message = “getLeft”) transfer the customer to the queue of another station. then leftSubTree Stations could discard customers by not transferring else if (message == “getRight”) them to another queue, and could generate new then rightSubTree customers. They could also wait a given period (in simulated time) before starting the next action. Custom types were declared as data records, without any actions (or procedures) of their own. [Krogdahl 2003]

November 7, 2010 Page 6 of 25

Thus at each time step, the program of the next station to Note that a class operation operated on the global state of be simulated would update the variables. the simulation and not just on the local variables of the class in which the operation is defined.xiii Also Simula-67 and Ole-Johan Dahl developed the idea lacked formal interfaces and instead relied on inheritance (first described in an IFIP workshop in 1967) of organizing from an abstract class thereby placing limitations to the objects into “classes” with “subclasses” that could inherit ability to invoke behavior independent of the class methods for performing operations from their superclasses. hierarchy. In this way, Simula 67 considerably improved the modularity of nondeterministic discrete event simulations. Also, although Simula had nondeterminism, it did not have concurrency.xiv According to [Krogdahl 2003]: Objects could act as processes that can execute in Planner “quasi-parallel” that is in fact a form of The two major paradigms for constructing semantic nondeterministic sequential execution in which a systems were procedural and logical. The simulation is organized as “independent” processes. procedural paradigm was epitomized by using Lisp Classes in Simula 67 have their own procedures that [McCarthy et al. 1962; Minsky, et al. 1968] recursive start when an object is generated. However, unlike procedures operating on list structures. The logical Algol procedures, objects may choose to temporarily paradigm was epitomized by uniform resolution theorem stop their execution and transfer the control to another provers [Robinson 1965]. process. If the control is later given back to the object, Planner [Hewitt 1969] was a kind of hybrid between the it will resume execution where the control last left off. procedural and logical paradigms.xv An implication of the A process will always retain the execution control form (P implies Q) was procedurally interpreted as until it explicitly gives it away. When the execution of xvi follows: an object reaches the end of its statements, it will become “terminated”, and can no longer be resumed  when assert P, assert Q (but local data and local procedures can still be  when goal Q, goal P accessed from outside the object).  when assert (not Q), assert (not P) The quasi-parallel sequencing is essential for the  when goal (not P) goal (not Q) simulation mechanism. Roughly speaking, it works as , follows: When a process has finished the actions to be Planner was the first programming language based on the performed at a certain point in simulated time, it pattern-directed invocation of procedural plans from decides when (again in simulated time) it wants the assertions and goals. It represented a rejection of the control back, and stores this in a local “next-event- resolution uniform proof procedure paradigm. time” variable. It then gives the control to a central “time-manager”, which finds the process that is to Smalltalk-72 execute next (the one with the smallest next-event- Planner, Simula 67, Smalltalk-72 [Kay 1975; Ingalls 1983] time), updates the global time variable accordingly, and computer networks had previously used message and gives the control to that process. passing. However, they were too complicated to use as the foundation for a mathematical theory of concurrency. Also The idea of this mechanism was to invite the they did not address fundamental issues of concurrency. programmer of a simulation program to model the underlying system by a set of processes, each was influenced by message passing in the describing some natural sequence of events in that pattern-directed invocation of Planner in developing system (e.g. the sequence of events experienced by Smalltalk-71. Hewitt was intrigued by Smalltalk-71 but one car in a traffic simulation). was put off by the complexity of communication that included invocations with many fields including global, Note that a process may transfer control to another sender, receiver, reply-style, status, reply, operator, process even if it is currently inside one or more etc. procedure calls. Thus, each quasi-parallel process will have its own stack of procedure calls, and if it is not In November 1972 Kay visited MIT and discussed some of executing, its “reactivation point” will reside in the his ideas for Smalltalk-72 building on the Logo work of innermost of these calls. Quasi-parallel sequencing is and the “little person” metaphor of analogous to the notion of co-routines [Conway 1963]. computation used for teaching children to program. Smalltak-72 made important advances in graphical user interfaces including code browsing.

November 7, 2010 Page 7 of 25

Such nondeterministic automata have the property of However, the message passing of Smalltalk-72 was quite bounded nondeterminism; that is, if a machine always halts complex [Kay 1975]. Code in the language was viewed by when started in its initial state, then there is a bound on the the interpreter as simply a stream of tokens. As Dan Ingalls number of states in which it halts. [1983] later described it:xvii The first (token) encountered (in a program) was Edsger Dijkstra further developed the nondeterministic looked up in the dynamic context, to determine the global state approach. Dijkstra's model gave rise to a receiver of the subsequent message. The name lookup controversy concerning . began with the class dictionary of the current Unbounded nondeterminism (also called unbounded activation. Failing there, it moved to the sender of that indeterminacy), is a property of concurrency by which the activation and so on up the sender chain. When a amount of delay in servicing a request can become binding was finally found for the token, its value unbounded as a result of arbitration of contention for became the receiver of a new message, and the shared resources while still guaranteeing that the request xviii interpreter activated the code for that object's class. will eventually be serviced. The Actor model provides the guarantee of service. In Dijkstra's model, although there Thus the message passing model in Smalltalk-72 was could be an unbounded amount of time between the closely tied to a particular machine model and execution of sequential instructions on a computer, a programming language syntax that did not lend itself to (parallel) program that started out in a well-defined state concurrency. Also, although the system was bootstrapped could terminate in only a bounded number of states on itself, the language constructs were not formally defined [Dijkstra 1976]. He believed that it was impossible to as objects that respond to eval messages as in the implement unbounded nondeterminism. definition of ActorScript [Hewitt 2010a]. However, there is no bound that can be placed on how long Concurrency it takes a computational circuit called an arbiter to settle. Arguably, the first concurrent programs were interrupt Arbiters are used in computers to deal with the handlers. During the course of its normal operation, a circumstance that computer clocks operate asynchronously computer needed to be able to receive information from with input from outside, e.g. keyboard input, disk access, outside (characters from a keyboard, packets from a network input, etc. So it could take an unbounded time for network, etc.). So when the information arrived, execution a message sent to a computer to be received and in the of the computer was “interrupted” and special code called meantime the computer could traverse an unbounded an interrupt handler was called to put the information in a number of states. Thus the computer may not be in any buffer where it could be subsequently retrieved. defined stable state for an unbounded period of time [Hewitt 2006]. Therefore computers have the property of In the early 1960s, interrupts began to be used to simulate unbounded nondeterminism. So there is an inconsistency the concurrent execution of several programs on a single between the nondeterministic state model of computation xix . Having concurrency with gave and the circuit model of arbiters. rise to the problem of . Originally, this problem was conceived as being one of Actors on a single computer. Edsger Dijkstra developed The invention of digital computers caused a decisive semaphores and later, [Brinch Hansen 1996; Hoare 1974] paradigm shift when the notion of an interrupt was developed monitors to solve the mutual exclusion problem. invented so that input that arrived asynchronously However, neither of these solutions provided a programming language construct that encapsulated access from outside could be incorporated in an ongoing to shared resources [Hewitt and Atkinson 1977, 1979; computation. At first concurrency was conceived Atkinson 1980]. using low level machine implementation concepts like threads, locks, channels, cores, queues, etc. The first models of computation (e.g. Turing machines, Post productions, the λ-calculus, etc.) were based on The Actor Model [Hewitt, Bishop, and Steiger 1973] and made use of a global state to represent a was based on message passing that was different from computational step (later generalized in [McCarthy and previous models of computation because the sender Hayes 1969] and [Dijkstra 1976]). Each computational step of a message is not intrinsic to the semantics of a was from one global state of the computation to the next communication: only the message and recipient are global state. The global state approach was continued in relevant.xx In this way, the Actor Model integrated for finite state machines and push down the following: stack machines, including their nondeterministic versions.

November 7, 2010 Page 8 of 25

1. the incremented and Y is sent the value of continue. If Z 2. interrupts ever accepts the stop message from X, then X terminates. 3. blocking method invocation Accepting the stop causes continue to be set to false, so after sends its next message, will receive 4. using locks Y go Y false as the value of its guard and will terminate. When both X 5. capability systems and Y have terminated, Z terminates because it no longer 6. co-routines has live processes providing input. 7. packet networks As the author of CSP points out, therefore, if the 8. email systems repetitive guarded command in the definition of Z were 9. Petri nets required to be fair, this program would have unbounded 10. Smalltalk-72 nondeterminism: it would be guaranteed to halt but there would be no bound on the final value of n.xxiii In actual 11. Simula-67 fact, the repetitive guarded commands of CSP are not 12. pattern-directed invocation (from Planner) required to be fair, and so the program may not halt [Hoare 1978]. This fact may be confirmed by a tedious The Actor model has laws that govern privacy and calculation using the semantics of CSP [Francez, Hoare, security [Baker and Hewitt 1977].xxi Lehmann, and de Roever 1979] or simply by noting that the semantics of CSP is based upon a conventional power The Actor model was a decisive break with previous domain and thus does not give rise to unbounded models of computation because asynchronous nondeterminism. communication cannot be implemented by Turing However, the following concurrent program in ActorScript machines etc. because the order of arrival of [Hewitt 2010a] will return an integer of unbounded size: messages cannot be logically inferred. Message passing is the foundation of many-core and client- Unbounded === cloud computing. behavior {  methods Actor Semantics start ( ) →  a start message is implemented by Consider the following program written in CSPxxii [Hoare let ( ::c = create SimpleCounter(n=0)), 1978]: Counter  let c be a Counter that is a created by [X :: Z!stop( )  SimpleCounter with count equal 0 || {c.go ( ),  send c a go message and concurrently Y :: guard: boolean; c.stop ( ),}}  return the value of sending c a stop guard := true; *[guard  SimpleCounter === Z!go( ); behavior implements Counter { Z?guard] Integer::n ,  n is the current count || Z :: n: integer; |  methods for messages are below n:= 0; continue: boolean; stop ( ) → n,}  stop returns count n continue := true; this.go ( ) →  go message to self does *[X?stop( ) exit (this.go ( ),) alsobecome (n=n+1) continue := false; []  exit sending self a go message concurrently Y?go( )   incrementing the count n n := n+1; Y!continue]] By the semantics of the Actor model of computation [Clinger 1981; Hewitt 2006], the result of sending According to Clinger [1981]: Unbounded a start message is an integer of unbounded this program illustrates global nondeterminism, since the size. nondeterminism arises from incomplete specification of the timing of signals between the three processes X, Y, The model of CSP deliberately had bounded and Z. The repetitive guarded command in the definition nondeterminism [Francez, Hoare, Lehmann, and de Roever of Z has two alternatives: either the stop message is 1979] whereas the Actor model has unbounded accepted from X, in which case continue is set to false, nondeterminism. Influence by Dijkstra, Hoare had been or a go message is accepted from Y, in which case n is

November 7, 2010 Page 9 of 25

convinced that a programming language with unbounded reason that we await outcomes is that we have no nondeterminism could not be implemented. Consequently alternative because of indeterminacy.xxvii it was not possible to guarantee that servers implemented using CSP would provide service to multiple clients. xxiv Reasoning about Actors

The principle of Actor induction is: In 1975, Irene Greif published the first operational model 1. Suppose that an Actor x has property P when it is of Actors in her dissertation. Two years after Greif created published her operational model, and Henry 2. Further suppose that if x has property P when it Baker published the Laws for Actors [Baker and Hewitt processes a message, then it has property P when 1977]. Other major milestones include [Clinger 1981] it processes the next message. introducing a based on power 3. Then x always has the property P. domains, and [Agha 1985] which further developed a complementary transition-based semantic model. In his doctoral dissertation, Aki Yonezawa developed

xxv further techniques for proving properties of Actor systems Logic Programming including those that make use of migration. Russ Atkinson Robert Kowalski developed the thesis that “computation developed techniques for proving properties of Actors that could be subsumed by deduction” [Kowalski 1988a] that are guardians of shared resources. Gerry Barber's 1981 he states was first proposed by Hayes [1973] in the form doctoral dissertation concerned reasoning about change in “Computation = controlled deduction.”xxvi [Kowalski knowledgeable office systems. 1979] Kowalski forcefully stated: There is only one language suitable for Early Actor Programming languages representing information -- whether declarative or Henry Lieberman, Dan Theriault, et al. developed Act1, an procedural -- and that is first-order predicate Actor programming language. Subsequently for his logic. There is only one intelligent way to process master‟s thesis, Dan Theriault developed Act2. These early information -- and that is by applying deductive proof of concept languages were rather inefficient and not inference methods. [Kowalski 1980] suitable for applications. In his doctoral dissertation, Ken

Kahn developed Ani, which he used to develop several The gauntlet was officially thrown in The Challenge of animations. Bill Kornfeld developed the Ether Open Systems [Hewitt 1985] to which [Kowalski 1988b] programming language for the Scientific Community replied in Logic-Based Open Systems. This was followed Metaphor in his doctoral dissertation. William Athas and up with [Hewitt and Agha 1988] in the context of the Nanette Boden [1988] developed Cantor which is an Actor Japanese Fifth Generation Project. programming language for scientific computing. Jean-

Pierre Briot [1988, 1999] developed means to extend According to Hewitt, et. al. and contrary to Kowalski and Smalltalk 80 for Actor computations. Darrell Woelk [1995] Hayes, computation in general cannot be subsumed by at MCC developed an Actor programming language for deduction and contrary to the quotation (above) attributed InfoSleuth agents in Rosette. to Hayes computation in general is not controlled deduction. Hewitt and Agha [1991] and other published Hewitt, Attardi, and Lieberman [1979] developed work argued that mathematical models of concurrency did proposals for delegation in message passing. This gave rise not determine particular concurrent computations because to the so-called inheritance anomaly controversy in object- they make use of arbitration for determining which oriented concurrent programming languages [Satoshi message is next in the arrival order when multiple Matsuoka and Aki Yonezawa 1993, Giuseppe Milicia and messages concurrently. For example Arbiters can be used Vladimiro Sassone 2004]. in the implementation of the arrival order. Since arrival orders are in general indeterminate, they cannot be deduced from prior information by Causal Consistency alone. Therefore mathematical logic cannot implement Some kinds of sequential consistencyxxviii are special concurrent computation in open systems. cases of causal consistency which is an expression of the laws for Actors [Hewitt and Baker 1977]. In concrete terms, typically we cannot observe the details by which the arrival order of messages determined. Consider the following implementation of a cell: in Attempting to do so affects the results and can even push ActorScript [Hewitt 2010a]:xxix the indeterminacy elsewhere. Instead of observing the internals of arbitration processes, we await outcomes. The

November 7, 2010 Page 10 of 25

Implementation of a Cell: First Illustration of causal consistency

Below SimpleCell is defined that implements Cell let (Cell::x = CreateCell(0),

SimpleCell === Cell::y= CreateCell(0)) behavior { list [{x.write (1); y.read }, ?::contents  “,” above means discretionary concurrency  with instance variable contents {y.write (1); x.read }] | implements Cell The above expression returns either list[1 0] or list[0, 1]. (These results can be calculated read →  read message does using the Computational Representation contents,  return contents Theorem.) write (?::nextContents) → It is impossible for the expression to return void alsoBecome (contents=nextContents)} list[0 0] for the following reason: When y

receives the read message there are two CreateCell(?::x ) === create (contents=x) possibilities: SimpleCell 1. It has sent an acknowledgment for the

write (1) message, in which case it must return 1 for the read message. Illustration of use of a Cell: 2. It has not sent an acknowledgment for a The following expression creates a cell x with initial write message and so can return 0 for the contents 5 and then concurrently writes to it with the read message. However, this means that x values 7 and 9 while concurrently reading the contents. must have previously sent an let(Cell::x = CreateCell(5)) acknowledgment for the write (1) message {x.write (7), x.write (9), x.read } and so when x subsequently receives a read message it must return 1.  “,” above means discretionary concurrency

The value of the above expression is 5, 7 or 9. On the other hand sequential evaluation proceeds as Second Illustration of causal consistency follows:

let (Cell::x = CreateCell(5)) let (Cell::x = CreateCell(0), {x.write (7); x.write (9); x.read } The value of the above expression is 9. Cell::y= CreateCell(0)) Of course the following expression: [{x.read ?? {1 : y.write (1); 0 : void }; let (Cell::x = CreateCell(5)) x.read }, {x.write (7), x.write (9); x.read }  “,” above means discretionary concurrency  “,” above means discretionary concurrency {y.read ?? {1 : x.write (1) 0 : void } evaluates to 7 or 9. ; ; y.read ] The above expression returns [0 0] because it is impossible to read a value from a cell that was not the initial value and never written to the cell.

November 7, 2010 Page 11 of 25

Third Illustration of causal consistency Atomic operation illustration: Below is a illustration of an atomic operation to swap let (Cell::x = CreateCell(0), the contents of two cells guarded by a where the contents of the lock are 0 if unlocked and 1 if locked: Cell::y= CreateCell(0)) {x.write (1), Swap(Cell::x, Cell::y, Atomic::lock) === {SimpleSpinLock(lock,1);  “,” above means discretionary concurrency  acquire the lock

[let (?::x1=x.read ); {y.write (1), x1}, let(?::temp=x.read ) {x.write (y.read );  “,” above means discretionary concurrency y.write (temp)}; [y.read ; x.read ]]}  swap the contents

 “;” means x is sent read after y responds lock.write (0);}  release the lock

The above expression can never return Extension versus Specialization [1 [1 0]] because if x returned 0 from the Programming languages like ActorScript [Hewitt 2010] second listed read message then y must have take the approach of extending behavior in contrast to the previously acknowledged the write (1) approach of specializing behavior: message which happened after the first listed  Type specialization: If type t1 is a subtype of type x read message returned 1 which must have t2, then instances of t1have all of the properties that are provable from the definition of type t2 happened after x acknowledged the write (1) [Liskov 1987, Liskov and Wing 2001]. message.  Type extension: A type can be extended to have additional (perhaps incompatible) properties from Locking illustration: the type that it extends. An extension type can Below is an (overly) simple implementation of a spin make use of the implementation of the type that it lock. More sophisticated implementations must be extends. Type extension is commonly used to used in practical applications. extend the behavior of software as well as applications. SimpleSpinLock(Atomic::x, ?::value)=== The term “inheritance” in object-oriented programming has x.conditionalWrite (value) ?? { been used (sometimes ambiguously) to mean both  conditionalWrite message can be specialization and extension.  implemented as an atomic instruction to Early Actor Programming languages  perform store in x if it differs from value Henry Lieberman, Dan Theriault, et al. developed Act1, an Actor programming language. Subsequently for his false : master‟s thesis, Dan Theriault developed Act2. These early  false that x was updated proof of concept languages were rather inefficient and not  in a more practical implementation, suitable for applications. In his doctoral dissertation, Ken  there would be backoff here Kahn developed Ani, which he used to develop several SimpleSpinLock(x, value);  retry animations. Bill Kornfeld developed the Ether true : void }  true that x was atomically programming language for the Scientific Community Metaphor in his doctoral dissertation. William Athas and  updated with value Nanette Boden [1988] developed Cantor which is an Actor programming language for scientific computing. Jean-

Pierre Briot [1988, 1999] developed means to extend Smalltalk 80 for Actor computations. Darrell Woelk [1995] at MCC developed an Actor programming language for InfoSleuth agents in Rosette. Hewitt, Attardi, and Lieberman [1979] developed proposals for delegation in message passing. This gave rise to the so-called inheritance anomaly controversy in object- oriented concurrent programming languages [Satoshi

November 7, 2010 Page 12 of 25

Matsuoka and Aki Yonezawa 1993, Giuseppe Milicia and Hairy Control Structure Redux Vladimiro Sassone 2004]. McDermott and Sussman in [1972] developed the Lisp- based language Conniver based on “hairy control Language constructs versus Library APIs structure” (first introduced in [Landin 1965]) that could Library Application Programming Interfaces (APIs) are an implement non-chronological backtracking that was more alternative way to introduce concurrency. For example, general than the chronological backtracking in Planner.  Futures in C++0x [Stroustrup et. al. 2008] provided Hewitt and others were skeptical of hairy control structure. additional capability for C++. Unfortunately, the Pat Hayes [1974] remarked: C++0x addition is verbose, inefficient and overly Their [Sussman and McDermott] solution, to give the rigid. user access to the implementation primitives of  Message Passing Interface (MPI) [Gropp et. al. 1998] Planner, is however, something of a retrograde step provides message passing capabilities. Unfortunately, (what are Conniver's semantics?). MPI is also verbose, inefficient and overly rigid.  GCD queues were an important advance in In the 1960‟s at the MIT AI Lab a remarkable culture grew commercial software. (See an implementation below.) up around “hacking” that concentrated on remarkable feats xxxi However, in general, queues are plumbing that are of programming. Growing out of this tradition, Gerry better placed inside abstractions rather than being Sussman and Guy Steele decided to try to understand exposed externally. Actors by reducing them to that they could understand and so developed a “Lisp-like language, In general, appropriately defined language constructs Scheme, based on the lambda calculus, but extended for provide greater power, flexibility, and efficiency than side effects, multiprocessing, and process xxx library APIs. synchronization.” [Sussman and Steele 1975] Unfortunately, their reductionist approach included Implementation GCD queues: primitives like START!PROCESS, STOP!PROCESS and Below is an implementation of GCD queues in EVALUATE!UNINTERRUPTIBLEY that had the following ActorScript [Hewitt 2010a] using the Swiss Cheese explanation:xxxii model [Hewitt and Atkinson 1977, 1979; Atkinson This is the synchronization primitive. It evaluates an 1980] (holes in the cheese are highlighted in grey): expression uninterruptedly; i.e. no other process may run until the expression has returned a value. SimpleGCDqueue === Of course, the above reductionist approach is very behavior queues{q} { unsatisfactory because it missed a crucial aspect of the | implements GCDqueue Actor model: the arrival ordering of messages.

dispatch_sync (theBlock) → McDermott, and Sussman [1972] developed the Lisp-based passThru (q) {hole (theBlock( );) language Conniver based on “hairy control structure” that  Semicolon above means hole is not could implement non-chronological backtracking that was  exited until theBlock responds. more general than the chronological backtracking in responded (r) { Planner. However, Hewitt and others were skeptical of void alsoDequeue(q)}}; hairy control structure. Pat Hayes remarked: this.dispatch_async (theBlock) → Their [Sussman and McDermott] solution, to give the {this ↞passThru(q) { user access to the implementation primitives of Planner, is however, something of a retrograde step  ↞ means that this is pushed the value (what are Conniver's semantics?). [Hayes 1974]  computed by the following expression Hewitt had concluded: hole (theBlock( );) One of the most important results that has emerged  Semicolon above means that the hole from the development of Actor semantics has been the is not exited until theBlock responds further development of techniques to semantically . responded r { analyze or synthesize control structures as patterns of void alsoDequeue(q)}}, passing messages. As a result of this work, we have  Comma above means that above is found that we can do without the paraphernalia of  is performed concurrently with below “hairy control structure." xxxiii(emphasis in original) void }}  dispatch_async method  immediately returns void Sussman and Steele [1975] noticed some similarities between Actor programs and the λ-calculus. They

November 7, 2010 Page 13 of 25

mistakenly concluded that they had reduced Actor 1. Direct use: Futures can be used directlyxl whereas programs to a “-passing programming style”: promises must first be resolvedxli to extract the It is always possible, if we are willing to specify outcome of a promise before it can be used. explicitly what to do with the answer, to perform any 2. Derivatives: According to [Miller 2006]: calculation in this way: rather than reducing to its “Messages sent to [a] promise cannot be delivered value, it reduces to an application of a continuation to until the promise is resolved, so they are buffered in its value. That is, in this continuation-passing FIFO order within the promise.” Derivative futures programming style, a function always “returns” its are different from promises in that a deferrable result by “sending” it to another function. (emphasis message sent to a derivative future results in the in original) creation of a new future for the outcome of the However, some Actor programming language constructs message. are not reducible to a continuation-passing style. For 3. Resource control: Unlike futures, promises do not example, push concurrency (i.e. …↢…) is not reducible to make use of sponsors for resource control. continuation-passing style.xxxiv Garbage Collection [Reynolds 1972] introduced hairy control structure Garbage collection (the automatic reclamation of unused using a primitive called escape. Sussman storage) was an important theme in the development of the and Steele called their variant of escape by the name “call Actor model. xxxv with current continuation.” Unfortunately, general use of escape is not compatible with usual hardware stack In his doctoral dissertation, Peter Bishop developed an disciple introducing considerable operational inefficiency. for garbage collection in distributed systems. xxxvi Also, using escape can leave customers stranded. Each system kept lists of links of pointers to and from Consequently, use of escape is generally avoided these other systems. Cyclic structures were collected by xxxvii days and exceptions are used instead so that clean up incrementally migrating Actors (objects) onto other can be performed. systems which had their addresses until a cyclic structure was entirely contained in a single system where the On the basis of their experience, Sussman and Steele garbage collector could recover the storage. developed the general thesis that Actors were merely the λ-calculus in disguise. Steele [1976] in the section “Actors Henry Baker developed an algorithm for real-time garbage ≡ Closures (mod Syntax)” disagreed with Hewitt who had collection is his doctoral dissertation. The fundamental “expressed doubt as to whether these underlying idea was to interleave collection activity with construction continuations can themselves be expressed as lambda activity so that there would not have to be long pauses expressions.” However, customers cannot be expressed as while collection takes place. λ-expressions because doing so would preclude being able to enforce the requirement that a customer will process at Lieberman and Hewitt [1983] developed a real time most one response (i.e. exception or value return). Also garbage collection based on the lifetimes of Actors implementing customers as λ expressions can leave (Objects). The fundamental idea was to allocate Actors customers stranded. (objects) in generations so that only the latest generations would have to be examined during a garbage collection. In summary, Sussman and Steele [1975] mistakenly concluded “we discovered that the „Actors' and the lambda expressions were identical in implementation.”xxxviii The Cosmic Cube actual situation is that the λ-calculus is capable of The Cosmic Cube was developed by Chuck Seitz et al. at expressing some kinds of sequential and parallel control Caltech providing architectural support for Actor systems. structures but, in general, not the concurrency expressed in A significant difference between the Cosmic Cube and the Actor model.xxxix On the other hand, the Actor model is most other parallel processors is that this multiple capable of expressing everything in the λ-calculus and instruction multiple-data machine used message passing more [Hewitt 2008f]. instead of shared variables for communication between concurrent processes. This computational model was Promises reflected in the hardware structure and operating system, and also the explicit message passing communication seen Promises [Liskov and Shrira 1988] are a lower level by the programmer. version of futures [Baker and Hewitt 1977] in the following respects:

November 7, 2010 Page 14 of 25

J–Machine So, in the spirit of Hewitt, our first step is to demand The J–Machine was developed by Bill Dally et al. at MIT that all things denoted by terms or accessed by names-- providing architectural support suitable for Actors. This values, registers, operators, processes, objects--are all included the following: of the same kind of thing; they should all be processes. Thereafter we regard access-by-name as the raw  Asynchronous messaging material of computation...  A uniform space of Actor addresses to which

messages could be sent concurrently regardless of However, some fundamental differences remain between whether the recipient Actor was local or nonlocal the Actor model and the –calculus.  A form of Actor pipelining π  The Actor model is founded on physics whereas the –calculus is founded on algebra. Concurrent Smalltalk (which can be modeled using Actors) π was developed to program the J Machine.  Semantics of the Actor model is based on message orderings in the Computational Representation Theorem. Semantics of the π-Calculus π–calculus is based on structural congruence in 's initial published work on concurrency various kinds of bisimulations and equivalences. [Milner 1973] was notable in that it positions mathematical semantics of communicating processes as a framework to Communication in the π -calculus takes the following understand a variety of interaction agents including the form: computer's interaction with memory. The framework of  input: u(x).P is a process that gets a message modeling was based on Scott's model of domains and as from a communication channel u before such was not based on sequential processes. His work proceeding as P, binding the message received to differed from the independently developed Actor model in the identifier x. In ActorScript [Hewitt 2010a], the following ways: this can be modeled as follows: {let x=u.get ( );  There are a fixed number of processes as opposed to P}xlii the Actor model which allows the number of Actors  output: ū(m).P is a process that puts a message m to vary dynamically on communication channel u before proceeding  The only quantities that can be passed in messages as P. In ActorScript, this can be modeled as are integers and strings as opposed to the Actor xliii model which allows the addresses of Actors to be follows: {u.put (m); P} passed in messages The above operations of the π-calculus can be  The processes have a fixed as opposed to implemented in Actor systems using a two-phase commit the Actor model which allows varying topology protocol [Knabe 1992; Reppy, Russo, and Xiao 2009]. The  Communication is synchronous as opposed to the overhead of communication in the π–calculus presents Actor model in which an unbounded time can elapse tremendous difficulties to its use in practical applications. between sending and receiving a message.  Unlike the Actor model, there is no arrival ordering Was the Actor model premature? and consequently there is only bounded The history of the Actor model raises the question of nondeterminism. However, with bounded whether it was premature. nondeterminism is impossible for a server to guarantee service to its clients, i.e., a client might Original definition of prematurity starve. As originally defined by Gunther Stent [1972], “A Building on the Actor model, Milner [1993] removed some discovery is premature if its implications cannot be of these restrictions in his work on the π-calculus: connected by a series of simple logical steps to Now, the pure lambda-calculus is built with just two contemporary canonical or generally accepted knowledge.” kinds of thing: terms and variables. Can we achieve the Ilana Lövy 2002 glossed the phrase "series of simple same economy for a ? Carl Hewitt, with logical steps" in Stent's definition as referring to the “target his Actors model, responded to this challenge long ago; community's ways of asking relevant questions, of he declared that a value, an operator on values, and a producing experimental results, and of examining new process should all be the same kind of thing: an Actor. evidence.” Michael Ghiselin [2002] argued that if a This goal impressed me, because it implies the “minority of scientists accept a discovery, or even pay homogeneity and completeness of expression ... But it serious attention to it, then the discovery is not altogether was long before I could see how to attain the goal in premature in the Stentian sense.” In accord with Ghiselin's terms of an algebraic calculus... argument, the Actor model was not premature. Indeed it

November 7, 2010 Page 15 of 25

enjoyed initial popularity and for a couple of decades Acknowledgment underwent steady development. Important contributions to the semantics of Actors have However, Stent in his original article also referred to a been made by: Gul Agha, Beppe Attardi, Henry Baker, development as premature such that when it occurred Will Clinger, Irene Greif, Carl Manning, Ian Mason, Ugo contemporaries did not seem to be able to do much with or Montanari, Maria Simi, Scott Smith, Carolyn Talcott, build on. This is what happened after a while with the Prasanna Thati, and Aki Yonezawa. Actor model. The reasons were twofold: 1. For over 30 years after the first publication of the Important contributions to the implementation of Actors Actor model, widely deployed computer have been made by: Bill Athas, Russ Atkinson, Beppe architectures developed in the direction of making Attardi, Henry Baker, Gerry Barber, Peter Bishop, Nanette a single sequential thread of execution run faster. Boden, Jean-Pierre Briot, Bill Dally, Peter de Jong, Jessie 2. For over 25 years after the first publication, there Dedecker, Ken Kahn, Henry Lieberman, Carl Manning, was no agreed standard by which software could Mark S. Miller, Tom Reinhardt, Chuck Seitz, Richard communicate high level data structures across Steiger, Dan Theriault, Mario Tokoro, Darrell Woelk, and organizational boundaries. Carlos Varela.

Research on the Actor model has been carried out at Before its time? Caltech , Kyoto University Tokoro According to Elihu M. Gerson [2002], phenomena that Laboratory, MCC, MIT Laboratory, lead people to talk about discoveries being before their SRI, , University of Illinois at Urbana- time can be analyzed as follows: Champaign Open Systems Laboratory, Pierre and Marie We can see the phenomenon of 'before its time' as Curie University (University of 6), University of composed of two separate steps. The first takes place Pisa, University of Tokyo Yonezawa Laboratory and when a new discovery does not get tied to the elsewhere. conventional knowledge of its day and remains unconnected in the literature. The second step occurs The members of the Silicon Valley Friday AM group made when new events lead to the 'rediscovery' of the valuable suggestions for improving this paper. Blaine unconnected results in a changed context that enables Garst found numerous bugs and made valuable comments or even facilitates its connection to the conventional including information on the historical development of knowledge of the rediscovering context. interfaces. Patrick Beard found bugs and suggested improvements in presentation. Now both of the above circumstances that held back the Actor model have changed with the development of The Actor model is intended to provide a foundation for (1) many-core computer architectures a information integration in privacy-friendly client-cloud (2) client-cloud computing computing [Hewitt 2009b]. By the criteria of Gerson, the Actor model might be described by some as before its time. Bibliography According to Hadasa Zuckerman and Joshua Lederberg and Gerry Sussman Structure and [1986], premature discoveries are those that were made but Interpretation of Computer Programs 1984. neglected. By their criteria it remains to be seen whether or Sarita Adve and Hans-J. Boehm. Memory Models: A Case not the Actor model was premature. for Rethinking Parallel Languages and Hardware CACM. July 2010. Gerson 2002 argued, Gul Agha. Actors: A Model of Concurrent Computation in But histories and sociological studies repeatedly show Distributed Systems Doctoral Dissertation. 1986. that we do not have a discovery until the scientific Gul Agha, Ian Mason, Scott Smith, and Carolyn Talcott. community accepts it as such and stops debating about “A foundation for Actor computation.” Journal of it. Until then the proposed solution is in an intermediate . 1997. state.” Joe Armstrong History of Erlang HOPL III. 2007. By his argument, the Actor model is a discovery but since Joe Armstrong. Erlang. CACM. September 2010. its practical importance is not yet accepted by the William Athas and Charles Seitz Multicomputers: community, its practical importance is not yet a discovery. message-passing concurrent computers IEEE Computer August 1988. William Athas and Nanette Boden Cantor: An Actor Programming System for Scientific Computing in

November 7, 2010 Page 16 of 25

Proceedings of the NSF Workshop on Object-Based Will Clinger. Foundations of Actor Semantics MIT Concurrent Programming. 1988. Special Issue of Mathematics Doctoral Dissertation. June 1981. SIGPLAN Notices. Tyler Close Web-key: Mashing with Permission Russ Atkinson. Automatic Verification of Serializers MIT WWW‟08. Doctoral Dissertation. June, 1980. Melvin Conway. Design of a separable transition-diagram Henry Baker. Actor Systems for Real-Time Computation compiler CACM. 1963. MIT EECS Doctoral Dissertation. January 1978. Ole-Johan Dahl and Kristen Nygaard. “Class and subclass Henry Baker and Carl Hewitt The Incremental Garbage declarations” IFIP TC2 Conference on Simulation Collection of Processes Proceeding of the Symposium Programming Languages. May 1967. on Artificial Intelligence Programming Languages. Ole-Johan Dahl and . Hierarchical Program SIGPLAN Notices 12, August 1977. Structures in “” Prentice Hall. Paul Baran. On Distributed Communications Networks 1972. IEEE Transactions on Communications Systems. March William Dally and Wills, . Universal mechanisms for 1964. concurrency PARLE „89. Gerry Barber. Reasoning about Change in Knowledgeable William Dally, et al. The Message-Driven Processor: A Office Systems MIT EECS Doctoral Dissertation. August Multicomputer Processing Node with Efficient 1981. Mechanisms IEEE Micro. April 1992. Peter Bishop Very Large Address Space Modularly and Earl Van Horn. Programming Semantics Extensible Computer Systems MIT EECS Doctoral for Multiprogrammed Computations CACM. March Dissertation. June 1977. 1966. Andreas Blass, Yuri Gurevich, Dean Rosenzweig, and A. Fine The Shaky Game: Einstein Realism and the Benjamin Rossman (2007a) Interactive -step Quantum Theory Press, Chicago, I: Axiomatization Logical Methods in 1986. Computer Science. 2007. Frederic Fitch. Symbolic Logic: an Introduction. Ronald Andreas Blass, Yuri Gurevich, Dean Rosenzweig, and Press. 1952 Benjamin Rossman (2007b) Interactive small-step , Tony Hoare, Daniel Lehmann, and algorithms II: Abstract state machines and the Willem-Paul de Roever. Semantics of nondeterminism, characterization theorem. Logical Methods in Computer concurrency, and communication Journal of Computer Science. 2007. and System Sciences. December 1979. Monitors and Concurrent Pascal: A Christopher Fuchs Quantum mechanics as quantum Personal History CACM 1996. information (and only a little more) in A. Khrenikov Don Box, David Ehnebuske, Gopal Kakivaya, Andrew (ed.) Quantum Theory: Reconstruction of Foundations Layman, Noah Mendelsohn, Henrik Nielsen, Satish (Växjo: Växjo University Press, 2002). Thatte, Dave Winer. Simple Object Access Protocol Blaine Garst. Origin of Interfaces Email to Carl Hewitt on (SOAP) 1.1 W3C Note. May 2000. October 2, 2009. Jean-Pierre Briot. Acttalk: A framework for object-oriented Elihu M. Gerson. Prematurity and Social Worlds in concurrent programming-design and experience 2nd Prematurity in Scientific Discovery. University of France-Japan workshop. 1999. California Press. 2002. Jean-Pierre Briot. From objects to Actors: Study of a Andreas Glausch and Wolfgang Reisig. Distributed limited symbiosis in Smalltalk-80 Rapport de Recherche Abstract State Machines and Their Expressive Power 88-58, RXF-LITP. Paris, France. September 1988. Informatik Berichete 196. Humboldt University of Berlin. Luca Cardelli, James Donahue, Lucille Glassman, Mick January 2006. Jordan, Bill Kalsow, Greg Nelson. Modula-3 report Adele Goldberg and Alan Kay (ed.) Smalltalk-72 (revised) DEC Systems Research Center Research Instruction Manual SSL 76-6. Xerox PARC. March Report 52. November 1989. 1976. Luca Cardelli and Andrew Gordon Mobile Ambients Dina Goldin and Peter Wegner. The Interactive Nature of FoSSaCS‟98. Computing: Refuting the Strong Church-Turing Thesis Arnaud Carayol, Daniel Hirschkoff, and Davide Sangiorgi. Minds and Machines March 2008. On the representation of McCarthy's amb in the π- . Application of Theorem Proving to Problem calculus “Theoretical Computer Science” February Solving IJCAI’69. 2005. Irene Greif and Carl Hewitt. Actor Semantics of Alonzo Church “A Set of postulates for the foundation of PLANNER-73 Conference Record of ACM Symposium logic (1&2)” Annals of Mathematics. Vol. 33, 1932. on Principles of Programming Languages. January 1975. Vol. 34, 1933. Irene Greif. Semantics of Communicating Parallel Alonzo Church The Calculi of Lambda-Conversion Professes MIT EECS Doctoral Dissertation. August Press. 1941. 1975.

November 7, 2010 Page 17 of 25

Pat Hayes Some Problems and Non-Problems in Carl Hewitt (2008b) “Large-scale Organizational Representation Theory AISB. Sussex. July, 1974 Computing requires Unstratified Reflection and Strong Werner Heisenberg. Physics and Beyond: Encounters and Paraconsistency” Coordination, Organizations, Conversations translated by A. J. Pomerans (Harper & Institutions, and Norms in Agent Systems III Jaime Row, New York, 1971), pp. 63 – 64. Sichman, Pablo Noriega, Julian Padget and Sascha Carl Hewitt, Peter Bishop and Richard Steiger. A Universal Ossowski (ed.). Springer-Verlag. Modular Actor Formalism for Artificial Intelligence http://organizational.carlhewitt.info/ IJCAI‟73. Carl Hewitt (2008c) Middle History of Logic Carl Hewitt, et al. Actor Induction and Meta-evaluation Programming: Resolution, Planner, Edinburgh Logic for Conference Record of ACM Symposium on Principles Computable Functions, Prolog and the Japanese Fifth Generation Project ArXiv 0904.3036. of Programming Languages, January 1974. Carl Hewitt (2008e). ORGs for Scalable, Robust, Privacy- Carl Hewitt and Henry Lieberman. Design Issues in Friendly Client Cloud Computing IEEE Internet Parallel Architecture for Artificial Intelligence MIT AI Computing September/October 2008. memo 750. Nov. 1983. Carl Hewitt (2008f) Common sense for concurrency and Carl Hewitt, Tom Reinhardt, Gul Agha, and Giuseppe inconsistency robustness using Direct LogicTM and the Attardi Linguistic Support of Receptionists for Shared Actor Model ArXiv 0812.4852. Resources MIT AI Memo 781. Sept. 1984. Carl Hewitt (2009a) Perfect Disruption: The Paradigm Carl Hewitt, et al. Behavioral Semantics of Nonrecursive Shift from Mental Agents to ORGs IEEE Internet Control Structure Proceedings of Colloque sur la Computing. Jan/Feb 2009. Programmation, April 1974. Carl Hewitt (2009b) A historical perspective on developing Carl Hewitt. How to Use What You Know IJCAI. foundations for client-cloud computing: iConsultTM & September, 1975. iEntertainTM Apps using iInfoTM Information Integration Carl Hewitt. Viewing Control Structures as Patterns of for iOrgsTM Information Systems (Revised version of Passing Messages AI Memo 410. December 1976. “Development of Logic Programming: What went Journal of Artificial Intelligence. June 1977. wrong, What was done about it, and What it might mean Carl Hewitt and Henry Baker Laws for Communicating for the future” AAAI Workshop on What Went Wrong. Parallel Processes IFIP-77, August 1977. AAAI-08.) ArXiv 0901.4934. Carl Hewitt and Russ Atkinson. Specification and Proof Carl Hewitt (2009c) Middle History of Logic Techniques for Serializers IEEE Journal on Software Programming: Resolution, Planner, Prolog and the Engineering. January 1979. Japanese Fifth Generation Project ArXiv 0904.3036 Carl Hewitt, Beppe Attardi, and Henry Lieberman. Carl Hewitt (2010a) ActorScript™ extension of C#®, ®, ® TM Delegation in Message Passing Proceedings of First Java and Objective C :, iAdaptive concurrency for TM International Conference on Distributed Systems antiCloud -privacy and security ArXiv 1008.2748 Huntsville, AL. October 1979. Tony Hoare Quick sort Computer Journal 5 (1) 1962. Carl Hewitt and Gul Agha. Guarded Horn clause Tony Hoare Monitors: An Operating System Structuring languages: are they deductive and Logical? in Artificial Concept CACM. October 1974. Intelligence at MIT, Vol. 2. MIT Press 1991. Tony Hoare. Communicating sequential processes CACM. Carl Hewitt and Jeff Inman. DAI Betwixt and Between: August 1978. From "Intelligent Agents" to Open Systems Science Tony Hoare. Communicating Sequential Processes IEEE Transactions on Systems, Man, and Cybernetics. Prentice Hall. 1985. Nov./Dec. 1991. W. Horwat, Andrew Chien, and William Dally. Experience Carl Hewitt and Peter de Jong. Analyzing the Roles of with CST: Programming and Implementation PLDI. Descriptions and Actions in Open Systems Proceedings 1989. of the National Conference on Artificial Intelligence. Daniel Ingalls. Design Principles Behind Smalltalk. Byte. August 1983. August 1981. Carl Hewitt. (2006). “What is Commitment? Physical, M. Jammer The EPR Problem in Its Historical Organizational, and Social” COIN@AAMAS‟06. Development in Symposium on the Foundations of (Revised version to be published in Springer Verlag Modern Physics: 50 years of the Einstein-Podolsky- Lecture Notes in Artificial Intelligence. Edited by Javier Rosen Gedankenexperiment, edited by P. Lahti and P. Vázquez-Salceda and Pablo Noriega. 2007) April 2006. Mittelstaedt. World Scientific. Singapore. 1985. Carl Hewitt (2007a). “Organizational Computing Requires Simon Peyton Jones, Andrew Gordon, Sigbjorn Finne. Unstratified Paraconsistency and Reflection” Concurrent Haskell, POPL‟96. COIN@AAMAS. 2007. Ken Kahn. A Computational Theory of Animation MIT Carl Hewitt (2008a) Norms and Commitment for iOrgsTM EECS Doctoral Dissertation. August 1979. Information Systems: Direct LogicTM and Participatory Argument Checking ArXiv 0906.2756.

November 7, 2010 Page 18 of 25

Matthias Kaiser and Jens Lemcke Towards a Framework and Liuba Shrira Promises: Linguistic for Policy-Oriented Enterprise Management AAAI Support for Efficient Asynchronous Procedure Calls 2008. SIGPLAN‟88. Alan Kay. “Personal Computing” in Meeting on 20 Years Barbara Liskov and Jeannette Wing. Behavioral subtyping of Computing Science Instituto di Elaborazione della using invariants and constraints in “ for Informazione, Pisa, Italy. 1975. distributed processing: a survey of object-oriented http://www.mprove.de/diplom/gui/Kay75.pdf approaches” Cambridge University Press. 2001. Frederick Knabe A Distributed Protocol for Channel- Carl Manning. Traveler: the Actor observatory ECOOP Based Communication with Choice PARLE‟92. 1987. Also appears in Lecture Notes in Computer Bill Kornfeld and Carl Hewitt. The Scientific Community Science, vol. 276. Metaphor IEEE Transactions on Systems, Man, and Carl Manning,. Acore: The Design of a Core Actor Cybernetics. January 1981. Language and its Compile Master‟s Thesis. MIT EECS. Bill Kornfeld. Parallelism in Problem Solving MIT EECS May 1987. Doctoral Dissertation. August 1981. Satoshi Matsuoka and Aki Yonezawa. Analysis of Robert Kowalski Algorithm = Logic + Control CACM. Inheritance Anomaly in Object-Oriented Concurrent July 1979. Programming Languages Research Directions in Robert Kowalski. Response to questionnaire Special Issue Concurrent Object-Oriented Programming MIT Press. on Knowledge Representation. SIGART Newsletter. 1993. February 1980. John McCarthy Programs with common sense Symposium Robert Kowalski (1988a) The Early Years of Logic on Mechanization of Thought Processes. National Programming CACM. January 1988. Physical Laboratory, UK. Teddington, England. 1958. Robert Kowalski (1988b) Logic-based Open Systems John McCarthy. A Basis for a Mathematical Theory of Representation and Reasoning. Stuttgart Conference Computation Western Joint Computer Conference. 1961. Workshop on Discourse Representation, Dialogue John McCarthy, Paul Abrahams, Daniel Edwards, Timothy tableaux and Logic Programming. 1988. Hart, and Michael Levin. Lisp 1.5 Programmer’s Stein Krogdahl. The birth of Simula HiNC 1 Conference. Manual MIT Computation Center and Research Trondheim. June 2003. Laboratory of Electronics. 1962. How to make a multiprocessor computer John McCarthy. Situations, actions and causal laws that correctly executes multiprocess programs IEEE Technical Report Memo 2, Stanford University Artificial Transactions on Computers. 1979. Intelligence Laboratory. 1963. Peter Landin. A Generalization of Jumps and Labels John McCarthy and Patrick Hayes. Some Philosophical UNIVAC Systems Programming Research Report. Problems from the Standpoint of Artificial Intelligence August 1965. (Reprinted in Higher Order and Symbolic Machine Intelligence 4. Edinburgh University Press. Computation. 1998) 1969. Peter Landin A correspondence between ALGOL 60 and Giuseppe Milicia and Vladimiro Sassone. The Inheritance Church‟s lambda notation CACM. August 1965. Anomaly: Ten Years After SAC. Nicosia, Cyprus. March Edward Lee and Stephen Neuendorffer (June 2004). 2004. Classes and Subclasses in Actor-Oriented Design. Mark S. Miller Robust Composition: Towards a Unified Conference on Formal Methods and Models for Approach to Access Control and Concurrency Control Codesign (MEMOCODE). Doctoral Dissertation. John Hopkins. 2006. Steven Levy : Heroes of the Computer Revolution George Milne and Robin Milner. “Concurrent processes Doubleday. 1984. and their syntax” JACM. April, 1979. Henry Lieberman. An Object-Oriented Simulator for the Robert Milne and . A Theory of Apiary Conference of the American Association for Programming Language Semantics Chapman and Hall. Artificial Intelligence, Washington, D. C., August 1983 1976. Henry Lieberman. Thinking About Lots of Things at Once Robin Milner Processes: A Mathematical Model of without Getting Confused: Parallelism in Act 1 MIT AI Computing Agents Proceedings of Bristol Logic memo 626. May 1981. Colloquium. 1973. Henry Lieberman. A Preview of Act 1 MIT AI memo 625. Robin Milner Elements of interaction: June 1981. lecture CACM. January 1993. Henry Lieberman and Carl Hewitt. A real Time Garbage (ed.) Semantic Information Processing MIT Collector Based on the Lifetimes of Objects CACM June Press. 1968. 1983. Eugenio Moggi Computational lambda-calculus and Barbara Liskov Data abstraction and hierarchy Keynote monads IEEE Symposium on Logic in Computer Science. address. OOPSLA‟87. Asilomar, California, June 1989.

November 7, 2010 Page 19 of 25

Allen Newell and Herbert Simon. The Logic Theory Akinori Yonezawa, Ed. ABCL: An Object-Oriented Machine: A Complex Information Processing System. Concurrent System MIT Press. 1990. Rand Technical Report P-868. June 15, 1956 Aki Yonezawa Specification and Verification Techniques Kristen Nygaard. SIMULA: An Extension of ALGOL to the for Parallel Programs Based on Message Passing Description of Discrete-Event Networks IFIP‟62. Semantics MIT EECS Doctoral Dissertation. December Carl Petri. Kommunikation mit Automate Ph. D. Thesis. 1977. University of Bonn. 1962. Hadasa Zuckerman and Joshua Lederberg. Postmature Simon Peyton Jones, Alastair Reid, Fergus Henderson, Scientific Discovery? Nature. December, 1986. Tony Hoare, and Simon Marlow. A semantics for imprecise exceptions Conference on Programming Language Design and Implementation. 1999. . A powerdomain construction SIAM Journal of Computing. September 1976. George Polya (1957) Mathematical Discovery: On Understanding, Learning and Teaching Problem Solving Combined Edition Wiley. 1981. Karl Popper (1935, 1963) Conjectures and Refutations: The Growth of Scientific Knowledge Routledge. 2002. John Reppy, Claudio Russo, and Yingqi Xiao Parallel Concurrent ML ICFP’09. John Reynolds. Definitional interpreters for higher order programming languages ACM Conference Proceedings. 1972. Bill Roscoe. The Theory and Practice of Concurrency Prentice-Hall. Revised 2005. Dana Scott and Christopher Strachey. Toward a mathematical semantics for computer languages Oxford Programming Research Group Technical Monograph. PRG-6. 1971 Charles Seitz. The Cosmic Cube CACM. Jan. 1985. Peter Sewell, et. al. x86-TSO: A Rigorous and Usable Programmer‟s Model for x86 CACM. July 2010. Michael Smyth. Power domains Journal of Computer and System Sciences. 1978. Guy Steele Jr. Lambda: The Ultimate Declarative MIT AI Memo 379. November 1976. Gunther Stent. Prematurity and Uniqueness in Scientific Discovery Scientific American. December, 1972. Gerry Sussman and Guy Steele Scheme: An Interpreter for Extended Lambda Calculus AI Memo 349. December, 1975. Daniel Theriault. A Primer for the Act-1 Language MIT AI memo 672. April 1982. Daniel Theriault. Issues in the Design and Implementation of Act 2 MIT AI technical report 728. June 1983. Hayo Thielecke An Introduction to Landin’s “A Generalization of Jumps and Labels” Higher-Order and Symbolic Computation. 1998. Dave Thomas and Brian Barry. Using Active Objects for Structuring Service Oriented Architectures: Anthropomorphic Programming with Actors Journal of Object Technology. July-August 2004. Darrell Woelk. Developing InfoSleuth Agents Using Rosette: An Actor Based Language Proceedings of the CIKM '95 Workshop on Intelligent Information Agents. 1995.

November 7, 2010 Page 20 of 25

The operations of reading the balance and making withdrawals are commutative to the extent that their order End Notes doesn‟t matter. For example the following expression i returns 2 even though the withdrawals can occur in either In part, this section extends some material that was order: submitted to Wikipedia. let ( ::a = CreateAccount(5)) Account ii The receiver might be on another computer and in any {a.withdraw (1), a.withdraw (2); a.balance } case can make use of threads, locks, queues, cores, iv channels, etc. as it sees fit. including those involving unbounded nondeterminism

Messages in the Actor model are generalizations of v packets in Internet computing in that they need not be One solution is to develop a concurrent variant of the received in the order sent. Not providing the order of Lisp meta-circular definition [McCarthy, Abrahams, delivery guarantee allows packet switching to buffer Edwards, Hart, and Levin 1962] that was inspired by packets, use multiple paths to send packets, resend Turing's Universal Machine [Turing 1936]. If exp is a Lisp damaged packets, and to provide other optimizations. expression and env is an environment that assigns values For example, Actors are allowed to pipeline the to identifiers, then the procedure Eval with arguments exp processing of messages. What this means is that in the and env evaluates exp using env. In the concurrent course of processing a message m1, an Actor can designate variant, eval (env) is a message that can be sent to exp to the behavior to be used to process the next message, and cause exp to be evaluated. Using such messages, modular then in fact begin processing another message m2 before it meta-circular definitions can be concisely expressed in the has finished processing m1. Just because an Actor is Actor model for universal concurrent programming allowed to pipeline the processing of messages does not languages (e.g. ActorScript [Hewitt 2010a]). mean that it must pipeline the processing. Whether a vi message is pipelined is an engineering tradeoff. E.g. processes in Erlang [Armstrong 2007] and vats in the object-capability model [Miller 2006]. iii Below is a simple implementation of an account that vii receives balance and withdraw messages: In part, this section extends some material that was submitted to Wikipedia and [Hewitt 2008f]. SimpleAccount ===  SimpleAccount is defined viii Turing [1936] stated: behavior { the behavior of the computer at any moment is determined by the symbols which he [the computer] is Currency::theBalance,  theBalance is an observing, and his „state of mind‟ at that moment” and  instance variable of type Currency “there is a bound B to the number of symbols or | implements Account squares which the computer can observe at one moment. If he wishes to observe more, he must use balance → theBalance,  return balance successive observations.” Gödel‟s conception of computation was formally the withdraw (amount) →  for a withdraw message with amount same as Turing but more reductionist in motivation: There is a major difference between the historical amount ?? { contexts in which Turing and Gödel worked. Turing (> theBalance) : tackled the Entscheidungsproblem [recursive  amount is greater than the value of theBalance decidability of provability] as an interesting throw OverdrawnException; mathematical problem worth solving; he was hardly aware of the fierce foundational debates. Gödel on the else : other hand, was passionately interested in the void, alsoBecome (theBalance= foundations of mathematics. Though not a student of theBalance - amount)}} Hilbert, his work was nonetheless deeply entrenched  return void also the next message is in the framework of Hilbert‟s finitistic program, whose  processed with amount deducted main goal was to provide a meta-theoretic finitary proof of the consistency of a formal system “containing a certain amount of finitary number CreateAccount(Currency::initialBalance)) === theory.” Shagrir [2006] create SimpleAccount(balance=initialBalance)

November 7, 2010 Page 21 of 25

suppose I just received a message; I read part of it and ix An Actor can have information about other Actors that it decide I should send my friend a message; I wait until my has received in a message about what it was like when the friend reads his message (the one I sent him, not the one I message was sent. See section of this paper on unbounded received); when he finishes reading his message, I return nondeterminism in ActorScript. to reading my message. I can choose to let my friend read the rest of my message, but then I cannot get the message x Attempting to observe the internal processes of a physical back to read it myself (note, however, that this can be arbiter affects its outcome because of indeterminacy. done using the Smalltalk object apply which will be discussed later). I can also choose to include permission xi However, the nondeterministic λ-calculus has bounded in my message to my friend to ask me to fetch some nondeterminism [Plotkin 1976] and thus is incapable of information from my message and to give that in implementing concurrency. information to him (accomplished by including: or in the message to the friend). However, anything my friend xii Petri [1962] fetches, I can no longer have. In other words, 1) An object (let's call it the CALLER) can send a xiii Consequently in Simula-76 there was no required message to another object (the RECEIVER) by locality of operations unlike the laws for locality in the simply mentioning the RECEIVER's name followed Actor mode [Baker and Hewitt 1977]. by the message. 2) The action of message sending forms a stack of xiv The ideas in Simula became widely known by the messages; the last message sent is put on the top. publication of [Dahl and Hoare 1972] at the same time that 3) Each attempt to receive information typically means the Actor model was being invented to formalize looking at the message on the top of the stack. concurrent computation using message passing [Hewitt, 4) The RECEIVER uses the eyeball, , the colon, :, and Bishop, and Steiger 1973]. the open colon, , to receive information from the xv message at the top of the stack. The development of Planner was inspired by the work of 5) When the RECEIVER completes his actions, the Karl Popper [1935, 1963], Frederic Fitch [1952], George message at the top of the stack is removed and the Polya [1954], and Herbert Simon [1956], ability to send and receive messages returns to the John McCarthy [1958, et. al. 1962], and Marvin Minsky CALLER. The RECEIVER may return a value to be [1968]. used by the CALLER. xvi 6) This sequence of sending and receiving messages, This turned out later to have a surprising connection viewed here as a process of stacking messages, with Direct Logic. See the Two-Way Deduction Theorem means that each message on the stack has a below. CALLER (message sender) and RECEIVER xvii (message receiver). Each time the RECEIVER is Subsequent versions of the Smalltalk language largely finished, his message is removed from the stack and followed the path of using the virtual methods of Simula in the CALLER becomes the current RECEIVER. The the message passing structure of programs. However now current RECEIVER can continue reading any Smalltalk-72 made primitives such as integers, floating information remaining in his message. point numbers, etc. into objects. The authors of Simula had 7) Initially, the RECEIVER is the first object in the considered making such primitives into objects but message typed by the programmer, who is the refrained largely for efficiency reasons. Java at first used CALLER. the expedient of having both primitive and object versions 8) If the RECEIVER's message contains an eyeball,  ; of integers, floating point numbers, etc. The C# colon, , or open colon, , he can obtain further programming language (and later versions of Java, starting : with Java 1.5) adopted the more elegant solution of using information from the CALLER's message. Any boxing and unboxing, a variant of which had been used information successfully obtained by the earlier in some Lisp implementations. RECEIVER is no longer available to the CALLER. 9) By calling on the object apply, the CALLER can xviii According to the Smalltalk-72 Instruction Manual give the RECEIVER the right to see all of the [Goldberg and Kay 1976]: CALLER's remaining message. The CALLER can There is not one global message to which all message no longer get information that is read by the “fetches” (use of the Smalltalk symbols eyeball,  ; colon, RECEIVER; he can, however, read anything that remains after the RECEIVER completes its actions. :, and open colon, ) refer; rather, messages form a hierarchy which we explain in the following way--

November 7, 2010 Page 22 of 25

10) There are two further special Smalltalk symbols like communications [Cardelli and Gordon 1998]). In useful in sending and receiving messages. One is the contrast, Actors in the Actor model possess an keyhole, , that lets the RECEIVER “peek” at the identity, and communicate by sending messages to the message. It is the same as the except it does not mailing addresses of other Actors (this style of remove the information from the message. The second symbol is the hash mark, #, placed in the communication can also be used to model channel-like message in order to send a reference to the next communications). token rather than the token itself. Process calculi can be modeled in the Actor model using a two-phase commit protocol [Knabe 1992]. xix Of course the same limitation applies to the Abstract xxi State Machine (ASM) model [Blass, Gurevich, These laws can be enforced by a proposed extension of Rosenzweig, and Rossman 2007a, 2007b; Glausch and the X86 architecture that will support the following Reisig 2006]. In the presence of arbiters, the global states operating environments: in ASM are mythical.  CLR and extensions (Microsoft)  JVM (Sun, IBM, Oracle, SAP) xx The sender is an intrinsic component of communication  Dalvik (Google) in the following previous models of computation: Many-core architecture has made the above extension  Petri Nets: the input places of a transition are an necessary in order to provide the following: intrinsic component of a computational step  concurrent nonstop automatic storage reclamation (transition). (garbage collection) and relocation to improve  λ-Calculus: the expression being reduced is an intrinsic component of a computational step efficiency, (reduction).  prevention of memory corruption that otherwise results  Simula: the stack of the caller is an intrinsic from programming languages like C and C++ using component of a computation step (method invocation). thousands of threads in a process,  Smalltalk 72: the invoking token stream is an intrinsic  nonstop migration of iOrgs (while they are in operation) component of a computation step (message send). within a computer and between distributed computers Process calculi (e.g. [Milner 1993; Cardelli and Gordon

1998]) are closely related to the Actor model. There are xxii many similarities between the two approaches, but also In summary, CSP differed from the Actor model in the several differences (some philosophical, some technical): following respects:  There is only one Actor model (although it has  The concurrency primitives of CSP were input, output, guarded commands, and parallel composition whereas numerous formal systems for design, analysis, the Actor model is based on asynchronous one-way verification, modeling, etc.); there are numerous messaging. process calculi, developed for reasoning about a  The fundamental unit of execution was a sequential variety of different kinds of concurrent systems at process in contrast to the Actor model in which various levels of detail (including calculi that execution was fundamentally concurrent. Sequential incorporate time, stochastic transitions, or constructs execution is problematical because multi-processor specific to application areas such as security analysis). computers are inherently concurrent.  The processes had a fixed topology of communication  The Actor model was inspired by the laws of physics whereas Actors had a dynamically changing topology and depends on them for its fundamental axioms, i.e. of communications. Having a fixed topology is physical laws (see Actor model theory); the process problematical because it precludes the ability to calculi were originally inspired by algebra [Milner dynamically adjust to changing conditions. 1993].  The processes were hierarchically structured using  Unlike the Actor model, the sender is an intrinsic parallel composition whereas Actors allowed the component of process calculi because they are defined creation of non-hierarchical execution using futures [Baker and Hewitt 1977]. Hierarchical parallel in terms of reductions (as in the λ-calculus). composition is problematical because it precludes the  Processes in the process calculi are anonymous, and ability to create a process that outlives its creator. Also communicate by sending messages either through message passing is the fundamental mechanism for named channels (synchronous or asynchronous), or via generating parallelism in the Actor model; sending ambients (which can also be used to model channel- more messages generates the possibility of more parallelism.

November 7, 2010 Page 23 of 25

 Communication was synchronous whereas Actor xxx However, they come with additional commitment. communication was asynchronous. Synchronous Inappropriate language constructs are difficult to leave communication is problematical because the behind. interacting processes might be far apart. xxxi  Communication was between processes whereas in the Notable members of this community included Bill Actor model communications are one-way to Actors. Gosper, Richard Greenblatt, Jack Holloway, Tom Knight, Synchronous communication between processes is Stuart Nelson, Peter Samson, , etc.. See problematical by requiring a process to wait on [Levy 1984]. multiple processes. xxxii  Data structures consisted of numbers, strings, and For semantics, Sussman and Steele [1975] proposed an arrays whereas in the Actor model data structures interpreter for a time-sliced processor. were Actors. Restricting data structures to numbers, xxxiii strings, and arrays is problematical because it prohibits Published in [Hewitt 1976, 1977]. programmable data structures. xxxiv  Messages contain only numbers and strings whereas In addition to being less general than the Actor model, in the Actor model messages could include the analysis in terms of continuation-passing style is also less addresses of Actors. Not allowing addresses in rigorous and more complex than Actor semantics. messages is problematical because it precludes xxxv flexibility in communication because there is no way A restricted form of the escape expression [Reynolds to supply another process with the ability to 1972] can be defined as follows in ActorScript [Hewitt communicate with an already known process. 2010a]:

escape in === xxiii Of course, n would not survive the termination of Z and identifier body so the value cannot actually be exhibited after termination! behavior { implements Expression In the ActorScript [Hewitt 2010a] program below, the eval (Environment::e) with Customer::c → unbounded count is sent to the customer of the start body. message so that it appears externally. eval (e.bind (identifier,

xxiv Hoare [1985] developed a revised version of CSP with to: ((?::v) with Customer::stranded → unbounded nondeterminism [Roscoe 2005]. {c.return (v), noResponse})))}  the return value v has been xxv See [Hewitt 2008c] for a more complete history.  received as an argument to the  continuation in a λ method xxvi  The customer will This thesis was also implicit in one interpretation of  most likely be left hanging Cordell Green‟s earlier work [Green 1969]. Note that the continuation customer stranded is most xxvii Although [Goldin and Wegner 2008] may seem likely stranded. And if the customer stranded is actually superficially similar, it unfortunately failed to comprehend used then the caller of the escape continuation will most previous publications on the Actor model (e.g. [Hewitt, likely be rather surprised at the return! This is an important Bishop and Steiger 1973], [Hewitt 1977], and [Hewitt and reason that customers are not λ expressions contra [Steele Agha 1988]). 1976]. Sussman and Steele [1975] developed a version of xxviii For example see [Lamport 1979; Sewell, et. al. escape for Scheme named call with current continuation, a 2010]. restricted version of which can be implemented in ActorScript as follows: xxix The cell interface can be defined as follows: callWithCurrentContinuation expression === Cell ===  Cell is defined behavior { implements Expression interface {  to be an interface with the following methods eval (Environment::e) with Customer::c → eval (e)( ? ↤read( ),  read message expression. void ↤ write(?::nextContents) } (?::v)with Customer::stranded →

 write message with nextContents returns void {c.return (v), noResponse })}

November 7, 2010 Page 24 of 25

However, customers differ from continuations because sending more than one response to a customer causes an exception to be thrown. Consequently, ActorScript [Hewitt 2010a] does not allow violation of stack discipline meaning that customers do not implement “hairy control structure” (the name given in [McDermott and Sussman 1972] for the control structure invented in [Landin 1965, Thielecke 1998]). Unfortunately, hairy control structure causes inefficiency and can make programs difficult to comprehend. ActorScript has much better ways than hairy control structure to implement generators, co-routines, etc. (See discussion below.) xxxvi See implementations of continuations in ActorScript above. xxxvii missing from Scheme xxxviii This error was partially acknowledged in some of their subsequent work. xxxix The λ-calculus includes the following limitations:  Message arrival ordering cannot be implemented.  Actors cannot be implemented whose behavior evolves with time.  The λ-calculus does not have exceptions and consequently neither does Scheme [Sussman and Steele 1975].  Attempting to reduce Actor customers to continuation functions was unsuccessful, e.g., it led to the hanging customer issue (see above). xl as in 3+future(f(4)) xli as in the following: resolve promise(f(4)) {value v : 3+v, exception e : throw e} xlii Note that there is a limitation on concurrency because u.get ( ) must complete before P starts xliii As above, there is a limitation on concurrency because u.put (m) must complete before P starts

November 7, 2010 Page 25 of 25