Communication-safe web programming in TypeScript with routed multiparty session types
File(s)main.pdf (921.87 KB)
Accepted version
Author(s)
Miu, A
Ferreira Ruiz, F
Yoshida, N
Zhou, F
Type
Conference Paper
Abstract
Modern web programming involves coordinating interactions between browser clients and a server. Typically, the interactions in web-based distributed systems are informally described, making it hard to ensure correctness, especially communication safety, i.e. all endpoints progress without type errors or deadlocks, conforming to a specified protocol. We present STScript, a toolchain that generates TypeScript APIs for communication-safe web development over WebSockets, and RouST, a new session type theory that supports multiparty communications with routing mechanisms. STScript provides developers with TypeScript APIs generated from a communication protocol specification based on RouST. The generated APIs build upon TypeScript concurrency practices, complement the event-driven style of programming in full-stack web development, and are compatible with the Node.js runtime for server-side endpoints and the React.js framework for browser-side endpoints. RouST can express multiparty interactions routed via an intermediate participant. It supports peer-to-peer communication between browser-side endpoints by routing communication via the server in a way that avoids excessive serialisation. RouST guarantees communication safety for endpoint web applications written using STScript APIs. We evaluate the expressiveness of STScript for modern web programming using several production-ready case studies deployed as web applications.
Date Issued
2021-03-02
Online Publication Date
2021-03-04T15:29:43Z
Date Acceptance
2020-12-20
ISBN
9781450383257
Publisher
ACM
Start Page
94
End Page
106
Journal / Book Title
CC 2021: Proceedings of the 30th ACM SIGPLAN International Conference on Compiler Construction
Copyright Statement
© 2021 Association for Computing Machinery. This is the author's version of the work. It is posted here by permission of ACM for your personal use. Not for redistribution. The definitive version was published in CC 2021: Proceedings of the 30th ACM SIGPLAN International Conference on Compiler Construction, (Mar 2021) https://dl.acm.org/doi/10.1145/3446804.3446854
Sponsor
Engineering & Physical Science Research Council (EPSRC)
Engineering & Physical Science Research Council (EPSRC)
Engineering & Physical Science Research Council (E
Engineering & Physical Science Research Council (EPSRC)
Engineering & Physical Science Research Council (EPSRC)
Engineering and Physical Sciences Research Council
Engineering & Physical Science Research Council (E
Engineering & Physical Science Research Council (E
Engineering & Physical Science Research Council (E
Engineering and Physical Sciences Research Council
The National Cyber Security Centre (NCSC)
Grant Number
EP/K011715/1
EP/T006544/1
ERI 025567 (EP/K034413/1)
EP/N027833/1
EP/T014709/1
EP/V000462/1
EP/V000462/1
20103649
PO 20131167
EP/L00058X/1, PO 20131167
4214176 / RFA 20601
Source
The International Conference on Compiler Construction (CC)
Subjects
cs.PL
cs.PL
cs.SE
Publication Status
Published
Start Date
2021-03-02
Finish Date
2021-03-03
Country
Virtual