Affiliation:
1. University of Edinburgh, UK
2. University of Kansas, USA
Abstract
Session types statically guarantee that communication complies with a protocol. However, most accounts of session typing do not account for failure, which means they are of limited use in real applications---especially distributed applications---where failure is pervasive.
We present the first formal integration of asynchronous session types with exception handling in a functional programming language. We define a core calculus which satisfies preservation and progress properties, is deadlock free, confluent, and terminating.
We provide the first implementation of session types with exception handling for a fully-fledged functional programming language, by extending the Links web programming language; our implementation draws on existing work on effect handlers. We illustrate our approach through a running example of two-factor authentication, and a larger example of a session-based chat application where communication occurs over session-typed channels and disconnections are handled gracefully.
Funder
Engineering and Physical Sciences Research Council
Publisher
Association for Computing Machinery (ACM)
Subject
Safety, Risk, Reliability and Quality,Software
Cited by
38 articles.
订阅此论文施引文献
订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献
1. Choral: Object-oriented Choreographic Programming;ACM Transactions on Programming Languages and Systems;2024-01-16
2. Deadlock-Free Separation Logic: Linearity Yields Progress for Dependent Higher-Order Message Passing;Proceedings of the ACM on Programming Languages;2024-01-05
3. MAG$$\pi $$!: The Role of Replication in Typing Failure-Prone Communication;Lecture Notes in Computer Science;2024
4. Session Types with Multiple Senders Single Receiver;Dependable Software Engineering. Theories, Tools, and Applications;2023-12-15
5. Polymorphic Typestate for Session Types;International Symposium on Principles and Practice of Declarative Programming;2023-10-22