Mixing Metaphors: Actors as Channels and Channels as Actors

Authors Simon Fowler, Sam Lindley, Philip Wadler



PDF
Thumbnail PDF

File

LIPIcs.ECOOP.2017.11.pdf
  • Filesize: 0.73 MB
  • 28 pages

Document Identifiers

Author Details

Simon Fowler
Sam Lindley
Philip Wadler

Cite As Get BibTex

Simon Fowler, Sam Lindley, and Philip Wadler. Mixing Metaphors: Actors as Channels and Channels as Actors. In 31st European Conference on Object-Oriented Programming (ECOOP 2017). Leibniz International Proceedings in Informatics (LIPIcs), Volume 74, pp. 11:1-11:28, Schloss Dagstuhl – Leibniz-Zentrum für Informatik (2017) https://doi.org/10.4230/LIPIcs.ECOOP.2017.11

Abstract

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.

Subject Classification

Keywords
  • Actors
  • Channels
  • Communication centric Programming Languages

Metrics

  • Access Statistics
  • Total Accesses (updated on a weekly basis)
    0
    PDF Downloads

References

  1. Actors and Hopac, 2016. URL: https://www.github.com/Hopac/Hopac/blob/master/Docs/Actors.md.
  2. Gul Agha. Actors: A Model of Concurrent Computation in Distributed Systems. MIT Press, Cambridge, MA, USA, 1986. Google Scholar
  3. Gul A Agha, Ian A Mason, Scott F Smith, and Carolyn L Talcott. A foundation for actor computation. Journal of Functional Programming, 7(01):1-72, 1997. Google Scholar
  4. Akka Typed, 2016. URL: http://doc.akka.io/docs/akka/current/scala/typed.html.
  5. Elvira Albert, Puri Arenas, and Miguel Gómez-Zamalloa. Testing of concurrent and imperative software using clp. In PPDP, pages 1-8. ACM, 2016. Google Scholar
  6. Joe Armstrong. Making reliable distributed systems in the presence of sodware errors. PhD thesis, The Royal Institute of Technology Stockholm, Sweden, 2003. Google Scholar
  7. Francesco Cesarini and Steve Vinoski. Designing for Scalability with Erlang/OTP. " O'Reilly Media, Inc.", 2016. Google Scholar
  8. Avik Chaudhuri. A Concurrent ML Library in Concurrent Haskell. In ICFP, pages 269-280, New York, NY, USA, 2009. ACM. Google Scholar
  9. Ezra Cooper, Sam Lindley, Philip Wadler, and Jeremy Yallop. Links: Web Programming Without Tiers. In Frank S. de Boer, Marcello M. Bonsangue, Susanne Graf, and Willem-Paul de Roever, editors, FMCO, volume 4709, pages 266-296. Springer Berlin Heidelberg, 2007. Google Scholar
  10. Frank S De Boer, Dave Clarke, and Einar Broch Johnsen. A complete guide to the future. In ESOP, pages 316-330. Springer, 2007. Google Scholar
  11. Joeri De Koster, Tom Van Cutsem, and Wolfgang De Meuter. 43 Years of Actors: A Taxonomy of Actor Models and Their Key Properties. In AGERE. ACM, 2016. Google Scholar
  12. Matthias Felleisen. On the expressive power of programming languages. Science of Computer Programming, 17(1-3):35-75, 1991. Google Scholar
  13. Cormac Flanagan, Amr Sabry, Bruce F. Duba, and Matthias Felleisen. The essence of compiling with continuations. In PLDI, pages 237-247. ACM, 1993. Google Scholar
  14. Cédric Fournet and Georges Gonthier. The reflexive CHAM and the join-calculus. In Hans-Juergen Boehm and Guy L. Steele Jr., editors, POPL, pages 372-385. ACM Press, 1996. URL: http://dl.acm.org/citation.cfm?id=237721, URL: http://dx.doi.org/10.1145/237721.237805.
  15. Simon Fowler, Sam Lindley, and Philip Wadler. Mixing Metaphors: Actors as Channels and Channels as Actors (Extended Version). CoRR, abs/1611.06276, 2017. URL: http://arxiv.org/abs/1611.06276.
  16. Lars-Åke Fredlund. A framework for reasoning about Erlang code. PhD thesis, The Royal Institute of Technology Stockholm, Sweden, 2001. Google Scholar
  17. Simon J. Gay and Vasco T. Vasconcelos. Linear type theory for asynchronous session types. Journal of Functional Programming, 20:19-50, January 2010. Google Scholar
  18. David K. Gifford and John M. Lucassen. Integrating functional and imperative programming. In LFP, pages 28-38. ACM, 1986. Google Scholar
  19. Philipp Haller. On the integration of the actor model in mainstream technologies: the Scala perspective. In AGERE, pages 1-6. ACM, 2012. Google Scholar
  20. Philipp Haller and Martin Odersky. Scala actors: Unifying thread-based and event-based programming. Theoretical Computer Science, 410(2):202-220, 2009. Google Scholar
  21. Paul Harvey. A linguistic approach to concurrent, distributed, and adaptive programming across heterogeneous platforms. PhD thesis, University of Glasgow, 2015. Google Scholar
  22. Jiansen He, Philip Wadler, and Philip Trinder. Typecasting actors: From Akka to TAkka. In SCALA, pages 23-33. ACM, 2014. Google Scholar
  23. Carl Hewitt, Peter Bishop, and Richard Steiger. A Universal Modular ACTOR Formalism for Artificial Intelligence. In IJCAI, pages 235-245, San Francisco, CA, USA, 1973. Morgan Kaufmann Publishers Inc. Google Scholar
  24. Rich Hickey. Clojure core.async Channels, 2013. URL: http://clojure.com/blog/2013/06/28/clojure-core-async-channels.html.
  25. C. A. R. Hoare. Communicating Sequential Processes. Communications of the ACM, 21(8):666-677, August 1978. Google Scholar
  26. Kohei Honda. Types for dyadic interaction. In Eike Best, editor, CONCUR'93, volume 715 of Lecture Notes in Computer Science, pages 509-523. Springer Berlin Heidelberg, 1993. Google Scholar
  27. Kohei Honda, Vasco T. Vasconcelos, and Makoto Kubo. Language primitives and type discipline for structured communication-based programming. In Chris Hankin, editor, ESOP, chapter 9, pages 122-138. Springer Berlin Heidelberg, Berlin/Heidelberg, 1998. Google Scholar
  28. Hopac, 2016. URL: http://www.github.com/Hopac/hopac.
  29. How are Akka actors different from Go channels?, 2013. URL: https://www.quora.com/How-are-Akka-actors-different-from-Go-channels.
  30. Raymond Hu, Nobuko Yoshida, and Kohei Honda. Session-based distributed programming in java. In ECOOP, pages 516-541. Springer, 2008. Google Scholar
  31. Is Scala’s actors similar to Go’s coroutines?, 2014. URL: http://stackoverflow.com/questions/22621514/is-scalas-actors-similar-to-gos-coroutines.
  32. Einar Broch Johnsen, Reiner Hähnle, Jan Schäfer, Rudolf Schlatte, and Martin Steffen. ABS: A core language for abstract behavioral specification. In FMCO, pages 142-164. Springer, 2010. Google Scholar
  33. R. Greg Lavender and Douglas C. Schmidt. Active object: An object behavioral pattern for concurrent programming. In John M. Vlissides, James O. Coplien, and Norman L. Kerth, editors, Pattern Languages of Program Design 2, pages 483-499. Addison-Wesley Longman Publishing Co., Inc., Boston, MA, USA, 1996. URL: http://dl.acm.org/citation.cfm?id=231958.232967.
  34. Paul B. Levy, John Power, and Hayo Thielecke. Modelling environments in call-by-value programming languages. Information and Computation, 185(2):182-210, 2003. Google Scholar
  35. Sam Lindley and J. Garrett Morris. A Semantics for Propositions as Sessions. In ESOP, pages 560-584. Springer, 2015. Google Scholar
  36. Sam Lindley and J. Garrett Morris. Embedding session types in haskell. In Haskell, pages 133-145. ACM, 2016. Google Scholar
  37. Massimo Merro and Davide Sangiorgi. On asynchrony in name-passing calculi. Mathematical Structures in Computer Science, 14(5):715-767, 2004. URL: http://dx.doi.org/10.1017/S0960129504004323.
  38. Robin Milner. Communicating and Mobile Systems: The Pi Calculus. Cambridge University Press, 1st edition, June 1999. Google Scholar
  39. Rumyana Neykova and Nobuko Yoshida. Multiparty session actors. In COORDINATION, pages 131-146. Springer, 2014. Google Scholar
  40. Joachim Niehren, Jan Schwinghammer, and Gert Smolka. A concurrent lambda calculus with futures. Theoretical Computer Science, 364(3):338-356, 2006. Google Scholar
  41. Luca Padovani and Luca Novara. Types for Deadlock-Free Higher-Order Programs. In Susanne Graf and Mahesh Viswanathan, editors, FORTE, pages 3-18. Springer International Publishing, 2015. Google Scholar
  42. Jennifer Paykin, Antal Spector-Zabusky, and Kenneth Foner. choose your own derivative. In TyDe, pages 58-59. ACM, 2016. Google Scholar
  43. Frank Pfenning and Dennis Griffith. Polarized substructural session types. In FoSSaCS, volume 9034 of Lecture Notes in Computer Science, pages 3-22. Springer, 2015. Google Scholar
  44. Proto.Actor, 2016. URL: http://www.proto.actor.
  45. John H. Reppy. Concurrent Programming in ML. Cambridge University Press, 2007. Google Scholar
  46. Davide Sangiorgi and David Walker. The π-calculus: a Theory of Mobile Processes. Cambridge University Press, 2003. Google Scholar
  47. Typed Actors, 2016. URL: https://github.com/knutwalker/typed-actors.
  48. Philip Wadler. Propositions as sessions. Journal of Functional Programming, 24(2-3):384-418, 2014. Google Scholar
Questions / Remarks / Feedback
X

Feedback for Dagstuhl Publishing


Thanks for your feedback!

Feedback submitted

Could not send message

Please try again later or send an E-mail