Communication-Safe Web Programming in TypeScript with Routed Multiparty Session Types

Anson Miu, Francisco Ferreira, Nobuko Yoshida, Fangyi Zhou
1/12/2021
cs.PLcs.SE

Official code: STScript-2020/cc21-artifact (2 stars, Jupyter Notebook, Apache-2.0, last commit 2021-01-05).

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.

Show full abstract

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.

View on arXivView PDF

Code Implementations(1)

Apache-2.0

Artifact for "Communication-Safe Web Programming in TypeScript with Routed Multiparty Session Types"

20Jupyter Notebook, TypeScriptDec 28, 20205 years agoApache-2.0

Similar Papers

Cite this paper

@article{miu2021communicationsafe,
  title  = {Communication-Safe Web Programming in TypeScript with Routed Multiparty Session Types},
  author = {Anson Miu and Francisco Ferreira and Nobuko Yoshida and Fangyi Zhou},
  year   = {2021},
  eprint = {2101.04622},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2101.04622}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2101.04622.svg)](https://codeofpaper.com/paper/2101.04622)

Discussion