Stay Safe under Panic: Affine Rust Programming with Multiparty Session Types
Nicolas Lagaillardie, Rumyana Neykova, Nobuko Yoshida

TL;DR
This paper introduces affine multiparty session types (AMPST) for Rust, enabling safe, reliable communication among distributed components with automatic cancellation and synchronization, demonstrated through practical protocol implementations.
Contribution
It extends multiparty session types with affine channels and cancellation, providing a new typing discipline and an automated Rust API generator for safe communication protocols.
Findings
MultiCrusty efficiently generates Rust APIs for communication protocols.
AMPST guarantees cancellation termination and prevents deadlocks.
Implemented protocols include OAuth, SMTP, and exception handling patterns.
Abstract
Communicating systems comprise diverse software components across networks. To ensure their robustness, modern programming languages such as Rust provide both strongly typed channels, whose usage is guaranteed to be affine (at most once), and cancellation operations over binary channels. For coordinating components to correctly communicate and synchronise with each other, we use the structuring mechanism from multiparty session types, extending it with affine communication channels and implicit/explicit cancellation mechanisms. This new typing discipline, affine multiparty session types (AMPST), ensures cancellation termination of multiple, independently running components and guarantees that communication will not get stuck due to error or abrupt termination. Guided by AMPST, we implemented an automated generation tool (MultiCrusty) of Rust APIs associated with cancellation termination…
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.
