Mixing Metaphors: Actors as Channels and Channels as Actors

Channel- and actor-based programming languages are both used in practice, but the two are often confused. Languages such as Go provide anonymous processes which communicate using buffers or rendezvous points---known as channels---while languages such as Erlang provide addressable processes---known as actors---each with a single incoming message queue. The lack of a common representation makes it difficult to reason about translations that exist in the folklore. We define a calculus lambda-ch for typed asynchronous channels, and a calculus lambda-act for typed actors. We define translations from lambda-act into lambda-ch and lambda-ch into lambda-act and prove that both are type- and semantics-preserving. We show that our approach accounts for synchronisation and selective receive in actor systems and discuss future extensions to support guarded choice and behavioural types.

[1]  Martin Odersky,et al.  Scala Actors: Unifying thread-based and event-based programming , 2009, Theor. Comput. Sci..

[2]  Raheel Ahmad,et al.  The π-Calculus: A theory of mobile processes , 2008, Scalable Comput. Pract. Exp..

[3]  Paul Harvey A linguistic approach to concurrent, distributed, and adaptive programming across heterogeneous platforms , 2015 .

[4]  Philipp Haller,et al.  On the integration of the actor model in mainstream technologies: the scala perspective , 2012, AGERE! 2012.

[5]  Gul A. Agha,et al.  ACTORS - a model of concurrent computation in distributed systems , 1985, MIT Press series in artificial intelligence.

[6]  Jiansen He,et al.  Type-parameterized actors and their supervision , 2014 .

[7]  Reiner Hähnle,et al.  ABS: A Core Language for Abstract Behavioral Specification , 2010, FMCO.

[8]  Robin Milner,et al.  The Polyadic π-Calculus: a Tutorial , 1993 .

[9]  Joe Armstrong,et al.  Making reliable distributed systems in the presence of software errors , 2003 .

[10]  Matthias Felleisen,et al.  On the Expressive Power of Programming Languages , 1990, European Symposium on Programming.

[11]  Douglas C. Schmidt,et al.  Active object: an object behavioral pattern for concurrent programming , 1996 .

[12]  Nobuko Yoshida,et al.  Session-Based Distributed Programming in Java , 2008, ECOOP.

[13]  Kohei Honda,et al.  Types for Dyadic Interaction , 1993, CONCUR.

[14]  Daniel Gooch,et al.  Communications of the ACM , 2011, XRDS.

[15]  Joeri De Koster,et al.  43 Years of Actors: a Taxonomy of Actor Models and Their Key Properties , 2016, AGERE!@SPLASH.

[16]  Vasco Thudichum Vasconcelos,et al.  Language Primitives and Type Discipline for Structured Communication-Based Programming Revisited: Two Systems for Higher-Order Session Communication , 1998, SecReT@ICALP.

[17]  Philip Wadler,et al.  Typecasting actors: from Akka to TAkka , 2014, SCALA@ECOOP.

[18]  Cédric Fournet,et al.  The reflexive CHAM and the join-calculus , 1996, POPL '96.

[19]  Vasco Thudichum Vasconcelos,et al.  Linear type theory for asynchronous session types , 2009, Journal of Functional Programming.

[20]  Luca Padovani,et al.  Types for Deadlock-Free Higher-Order Programs , 2015, FORTE.

[21]  Frank Pfenning,et al.  Polarized Substructural Session Types , 2015, FoSSaCS.

[22]  Robin Milner,et al.  Communicating and mobile systems - the Pi-calculus , 1999 .

[23]  Avik Chaudhuri,et al.  A concurrent ML library in concurrent Haskell , 2009, ICFP.

[24]  Joachim Niehren,et al.  A concurrent lambda calculus with futures , 2006, Theor. Comput. Sci..

[25]  John H. Reppy,et al.  Concurrent programming in ML , 1999 .

[26]  Frank S. de Boer,et al.  A Complete Guide to the Future , 2007, ESOP.

[27]  David K. Gifford,et al.  Integrating functional and imperative programming , 1986, LFP '86.

[28]  Carl Hewitt,et al.  A Universal Modular ACTOR Formalism for Artificial Intelligence , 1973, IJCAI.

[29]  Philip Wadler Propositions as sessions , 2014, J. Funct. Program..

[30]  Davide Sangiorgi,et al.  On asynchrony in name-passing calculi , 1998, Mathematical Structures in Computer Science.

[31]  Amr Sabry,et al.  The essence of compiling with continuations , 1993, PLDI '93.

[32]  Hayo Thielecke,et al.  Modelling environments in call-by-value programming languages , 2003, Inf. Comput..

[33]  Philip Wadler,et al.  Links: Web Programming Without Tiers , 2006, FMCO.

[34]  Sam Lindley,et al.  Embedding session types in Haskell , 2016, Haskell.

[35]  C. A. R. Hoare,et al.  Communicating sequential processes , 1978, CACM.

[36]  Lars-Åke Fredlund,et al.  A framework for reasoning about Erlang code , 2001 .

[37]  Carolyn L. Talcott,et al.  A foundation for actor computation , 1997, Journal of Functional Programming.

[38]  Sam Lindley,et al.  A Semantics for Propositions as Sessions , 2015, ESOP.

[39]  Elvira Albert,et al.  Testing of concurrent and imperative software using CLP , 2016, PPDP.