On the chemistry of typestate-oriented actors
Silvia Crafa, Luca Padovani

TL;DR
This paper demonstrates how typestate-oriented programming can be effectively integrated into the Actor Model using Scala Akka, enhancing type safety and protocol adherence in distributed asynchronous systems.
Contribution
It introduces a novel approach combining typestate-oriented programming with the Actor Model, supported by Scala's type system, to ensure protocol compliance in distributed actor systems.
Findings
Scala abstractions support natural typestate-oriented actor programming
Type safety is enhanced through Scala's type system and typed ActorRef
The approach is grounded in a theoretical framework based on the Join Calculus
Abstract
Typestate-oriented programming is an extension of the OO paradigm in which objects are modeled not just in terms of interfaces but also in terms of their usage protocols, describing legal sequences of method calls, possibly depending on the object's internal state. We argue that the Actor Model allows typestate-OOP in an inherently distributed setting, whereby objects/actors can be accessed concurrently by several processes, and local entities cooperate to carry out a communication protocol. In this article we illustrate the approach by means of a number of examples written in Scala Akka. We show that Scala's abstractions support clean and natural typestate-oriented actor programming with the usual asynchronous and non-blocking semantics. We also show that the standard type system of Scala and a typed wrapping of usual (untyped) Akka's ActorRef are enough to provide rich forms of type…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsLogic, programming, and type systems · Security and Verification in Computing · Distributed systems and fault tolerance
