[Paper Review] Speak Now: Safe Actor Programming with Multiparty Session Types (Extended Version)
Maty is the first actor language that combines static multiparty session types with full actor versatility, enabling multiple concurrent sessions and safe failure handling.
Actor languages such as Erlang and Elixir are widely used for implementing scalable and reliable distributed applications, but the informally-specified nature of actor communication patterns leaves systems vulnerable to costly errors such as communication mismatches and deadlocks. Multiparty session types (MPSTs) rule out communication errors early in the development process, but until now, the many-sender, single-receiver nature of actor communication has made it difficult for actor languages to benefit from session types. This paper introduces Maty, the first actor language design supporting both static multiparty session typing and the full power of actors taking part in multiple sessions. Maty therefore combines the error prevention mechanism of session types with the scalability and fault tolerance of actor languages. Our main insight is to enforce session typing through a flow-sensitive effect system, combined with an event-driven programming style and first-class message handlers. Using MPSTs allows us to guarantee communication safety: a process will never send or receive an unexpected message, nor will a session get stuck because an actor is waiting for a message that will never be sent. We extend Maty to support Erlang-style supervision and cascading failure, and show that this preserves Maty's strong metatheory. We implement Maty in Scala using an API generation approach, and demonstrate the expressiveness of our model by implementing a representative sample of the widely-used Savina actor benchmark suite; an industry-supplied factory scenario; and a chat server.
Motivation & Objective
- Motivate the need to prevent communication errors in actor-based distributed systems.
- Extend multiparty session types to work with actors by removing channel-based assumptions and enabling non-channel, reactive programming.
- Permit actors to participate in multiple sessions simultaneously while preserving safety and liveness properties.
- Incorporate Erlang-style supervision and cascading failures without breaking the core metatheory.
- Provide a Scala-based implementation and validate with benchmarks, a factory case study, and a chat server.
Proposed method
- Adopt an event-driven actor model where agents react to messages and suspend to await future messages.
- Enforce session types through a flow-sensitive effect system instead of explicit channels to maintain type safety.
- Allow unbounded and dynamic participation of actors in many concurrent sessions with stateful coordination between sessions.
- Model interaction between sessions using self-messages and state to enable session switching and inter-session effects.
- Extend the model with supervision hierarchies to support failure handling and recovery while preserving type guarantees.
- Implement Maty via API generation in Scala and validate with benchmarks, a factory scenario, and a chat server.

Experimental results
Research questions
- RQ1How can multiparty session types be statically enforced in an actor programming model without exposing channels (KP2)?
- RQ2Can actors safely participate in multiple concurrent sessions and still guarantee deadlock-free communication (KP3, KP4)?
- RQ3How can failure handling and supervision be integrated without compromising the strong metatheory (KP5)?
- RQ4Does the approach scale to realistic benchmarks and real-world scenarios such as factories and chat servers?
Key findings
- Maty provides static multiparty session typing for actors and guarantees that a process will never send or receive an unexpected message.
- Maty proves progress and preservation, yielding strong metatheory including global progress in sessions.
- Maty extends with Erlang-style supervision and cascading failure while maintaining safety guarantees.
- The Scala-based implementation uses an API-generation approach and demonstrates the model on benchmarks from Savina, a factory case study, and a chat server.
- The implementation shows expressive power by supporting a representative Savina suite, a factory scenario, and a chat server.

Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.