A linear decomposition of multiparty sessions for safe distributed programming
File(s)DTRS17-2.pdf (1.23 MB)
Published version
Author(s)
Scalas, Alceste
Dardha, Ornela
Hu, Raymond
Yoshida, Nobuko
Type
Report
Abstract
Multiparty Session Types (MPST) is a typing discipline for message-passing distributed processes
that can ensure properties such as absence of communication errors and deadlocks, and
protocol conformance. Can MPST provide a theoretical foundation for concurrent and distributed
programming in “mainstream” languages?
We address this problem by (1) developing the first encoding of a full-fledged multiparty
session -calculus into standard linear -calculus, and (2) using the encoding as the foundation
of a practical toolchain for safe multiparty programming in Scala.
Our encoding is type-preserving and operationally sound and complete. Importantly for
distributed applications, it preserves the choreographic nature of MPST and illuminates that
multiparty sessions (and their safety properties) can be precisely represented with a decomposition
into binary linear channels. Previous works have only studied the relation between (limited)
multiparty sessions and binary sessions by orchestration means.
We exploit these results to implement an automated generation of Scala APIs for multiparty
sessions. These APIs act as a layer on top of existing libraries for binary communication channels:
this allows distributed multiparty systems to be safely implemented over binary transports, as
commonly found in practice. Our implementation is also the first to support distributed multiparty
delegation: our encoding yields it for free, via existing mechanisms for binary delegation.
that can ensure properties such as absence of communication errors and deadlocks, and
protocol conformance. Can MPST provide a theoretical foundation for concurrent and distributed
programming in “mainstream” languages?
We address this problem by (1) developing the first encoding of a full-fledged multiparty
session -calculus into standard linear -calculus, and (2) using the encoding as the foundation
of a practical toolchain for safe multiparty programming in Scala.
Our encoding is type-preserving and operationally sound and complete. Importantly for
distributed applications, it preserves the choreographic nature of MPST and illuminates that
multiparty sessions (and their safety properties) can be precisely represented with a decomposition
into binary linear channels. Previous works have only studied the relation between (limited)
multiparty sessions and binary sessions by orchestration means.
We exploit these results to implement an automated generation of Scala APIs for multiparty
sessions. These APIs act as a layer on top of existing libraries for binary communication channels:
this allows distributed multiparty systems to be safely implemented over binary transports, as
commonly found in practice. Our implementation is also the first to support distributed multiparty
delegation: our encoding yields it for free, via existing mechanisms for binary delegation.
Date Issued
2017-01-01
Citation
Departmental Technical Report: 17/2, 2017, pp.1-73
Publisher
Department of Computing, Imperial College London
Start Page
1
End Page
73
Journal / Book Title
Departmental Technical Report: 17/2
Copyright Statement
© 2017 The Author(s). This report is available open access under a CC-BY-NC-ND (https://creativecommons.org/licenses/by-nc-nd/4.0/)
Publication Status
Published
Article Number
17/2