Relating Functional and Imperative Session Types
Hannes Saffrich, Peter Thiemann

TL;DR
This paper compares imperative and functional session types, demonstrating that the functional approach subsumes the imperative one through translations that preserve semantics and typing, clarifying their relative expressiveness.
Contribution
It shows that the functional session type system can simulate the imperative approach, revealing that limitations in the imperative calculus stem from its type restrictions.
Findings
Functional session types subsume imperative session types via translation.
Backwards translation from functional to imperative is semantics preserving.
Type restrictions in the imperative calculus limit its expressiveness.
Abstract
Imperative session types provide an imperative interface to session-typed communication. In such an interface, channel references are first-class objects with operations that change the typestate of the channel. Compared to functional session type APIs, the program structure is simpler at the surface, but typestate is required to model the current state of communication throughout. Following an early work that explored the imperative approach, a significant body of work on session types has neglected the imperative approach and opts for a functional approach that uses linear types to manage channel references soundly. We demonstrate that the functional approach subsumes the early work on imperative session types by exhibiting a typing and semantics preserving translation into a system of linear functional session types. We further show that the untyped backwards translation from the…
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 · Software Engineering Research · Security and Verification in Computing
