Abstract
This paper presents a framework for the static specification and safe programming of message passing protocols where the number and kinds of participants are dynamically instantiated. We develop the first theory of distributed multiparty session types (MPST) to support parameterised protocols with indexed roles—our framework statically infers the different kinds of participants induced by a protocol definition as role variants, and produces decoupled endpoint projections of the protocol onto each variant. This enables safe MPST-based programming of the parameterised endpoints in distributed settings: each endpoint can be implemented separately by different programmers, using different techniques (or languages). We prove the decidability of role variant inference and well-formedness checking, and the correctness of projection.
We implement our theory as a toolchain for programming such role-parametric MPST protocols in Go. Our approach is to generate API families of lightweight, protocol- and variant-specific type wrappers for I/O. The APIs ensure a well-typed Go endpoint program (by native Go type checking) will perform only compliant I/O actions w.r.t. the source protocol. We leverage the abstractions of MPST to support the specification and implementation of Go applications involving multiple channels, possibly over mixed transports (e.g., Go channels, TCP), and channel passing via a unified programming interface. We evaluate the applicability and run-time performance of our generated APIs using microbenchmarks and real-world applications.
We implement our theory as a toolchain for programming such role-parametric MPST protocols in Go. Our approach is to generate API families of lightweight, protocol- and variant-specific type wrappers for I/O. The APIs ensure a well-typed Go endpoint program (by native Go type checking) will perform only compliant I/O actions w.r.t. the source protocol. We leverage the abstractions of MPST to support the specification and implementation of Go applications involving multiple channels, possibly over mixed transports (e.g., Go channels, TCP), and channel passing via a unified programming interface. We evaluate the applicability and run-time performance of our generated APIs using microbenchmarks and real-world applications.
Original language | English |
---|---|
Title of host publication | Proceedings of the ACM on Programming Languages |
Editors | Philip Wadler |
Place of Publication | New York, NY |
Publisher | Association for Computing Machinery (ACM) |
Chapter | 29 |
Pages | 1-30 |
Number of pages | 30 |
Volume | 3 |
Edition | POPL |
DOIs | |
Publication status | Published - Jan 2019 |
Event | 46th ACM SIGPLAN Symposium on Principles of Programming Languages - Hotel Cascais Miragem, Cascais, Portugal Duration: 13 Jan 2019 → 19 Jan 2019 Conference number: 46 https://popl19.sigplan.org/program/program-POPL-2019 |
Publication series
Series | Proceedings of the ACM on Programming Languages |
---|---|
ISSN | 2475-1421 |
Symposium
Symposium | 46th ACM SIGPLAN Symposium on Principles of Programming Languages |
---|---|
Abbreviated title | POPL 19 |
Country/Territory | Portugal |
City | Cascais |
Period | 13/01/19 → 19/01/19 |
Internet address |
Keywords
- Go
- distributed programming
- indexed roles
- multiparty session types