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

01/12/2021
by   Anson Miu, et al.
0

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.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
04/02/2019

Multiparty Session Type-safe Web Development with Static Linearity

Modern web applications can now offer desktop-like experiences from with...
research
04/03/2020

Generating Interactive WebSocket Applications in TypeScript

Advancements in mobile device computing power have made interactive web ...
research
01/31/2019

Eliom: A Language for Modular Tierless Web Programming

Tierless Web programming languages allow programmers to combine client-s...
research
09/14/2020

Statically Verified Refinements for Multiparty Protocols

With distributed computing becoming ubiquitous in the modern era, safe d...
research
05/13/2022

Design-by-Contract for Flexible Multiparty Session Protocols – Extended Version

Choreographic models support a correctness-by-construction principle in ...
research
09/12/2019

Rusty Variation: Deadlock-free Sessions with Failure in Rust

Rusty Variation (RV) is a library for session-typed communication in Rus...
research
05/14/2021

Multiparty Session Types for Safe Runtime Adaptation in an Actor Language (Extended version)

Human fallibility, unpredictable operating environments, and the heterog...

Please sign up or login with your details

Forgot password? Click here to reset