Exceptional Asynchronous Session Types

被引:36
|
作者
Fowler, Simon [1 ]
Lindley, Sam [1 ]
Morris, J. Garrett [2 ]
Decova, Sara [1 ]
机构
[1] Univ Edinburgh, Edinburgh, Midlothian, Scotland
[2] Univ Kansas, Lawrence, KS 66045 USA
基金
英国工程与自然科学研究理事会;
关键词
session types; asynchrony; exceptions; web programming;
D O I
10.1145/3290341
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
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.
引用
收藏
页数:29
相关论文
共 50 条
  • [1] Multiparty asynchronous session types
    Honda, Kohei
    Yoshida, Nobuko
    Carbone, Marco
    [J]. ACM SIGPLAN NOTICES, 2008, 43 (01) : 273 - 284
  • [2] Multiparty Asynchronous Session Types
    Honda, Kohei
    Yoshida, Nobuko
    Carbone, Marco
    [J]. JOURNAL OF THE ACM, 2016, 63 (01)
  • [3] Multiparty Asynchronous Session Types
    Honda, Kohei
    Yoshida, Nobuko
    Carbone, Marco
    [J]. POPL'08: PROCEEDINGS OF THE 35TH ANNUAL ACM SIGPLAN-SIGACT SYMPOSIUM ON PRINCIPLES OF PROGRAMMING LANGUAGES, 2008, : 273 - 284
  • [4] On Urgency in Asynchronous Timed Session Types
    Murgia, Maurizio
    [J]. ELECTRONIC PROCEEDINGS IN THEORETICAL COMPUTER SCIENCE, 2018, (279): : 85 - 94
  • [5] Fair Refinement for Asynchronous Session Types
    Bravetti, Mario
    Lange, Julien
    Zavattaro, Gianluigi
    [J]. FOUNDATIONS OF SOFTWARE SCIENCE AND COMPUTATION STRUCTURES, FOSSACS 2021, 2021, 12650 : 144 - 163
  • [6] Asynchronous Session Types: Exceptions and Multiparty Interactions
    Carbone, Marco
    Yoshida, Nobuko
    Honda, Kohei
    [J]. FORMAL METHODS FOR WEB SERVICES, 2009, 5569 : 187 - +
  • [7] Linear type theory for asynchronous session types
    Gay, Simon J.
    Vasconcelos, Vasco T.
    [J]. JOURNAL OF FUNCTIONAL PROGRAMMING, 2010, 20 : 19 - 50
  • [8] A Gentle Introduction to Multiparty Asynchronous Session Types
    Coppo, Mario
    Dezani-Ciancaglini, Mariangiola
    Padovani, Luca
    Yoshida, Nobuko
    [J]. FORMAL METHODS FOR MULTICORE PROGRAMMING, SFM 2015, 2015, 9104 : 146 - 178
  • [9] Relating Session Types and Behavioural Contracts: The Asynchronous Case
    Bravetti, Mario
    Zavattaro, Gianluigi
    [J]. SOFTWARE ENGINEERING AND FORMAL METHODS (SEFM 2019), 2019, 11724 : 29 - 47
  • [10] Input urgent semantics for asynchronous timed session types
    Murgia, Maurizio
    [J]. JOURNAL OF LOGICAL AND ALGEBRAIC METHODS IN PROGRAMMING, 2019, 107 : 38 - 53