Communication-safe web programming in TypeScript with routed multiparty session types
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 error...
Main Authors: | , , , |
---|---|
Format: | Conference item |
Language: | English |
Published: |
Association for Computing Machinery
2021
|
_version_ | 1797112741106810880 |
---|---|
author | Miu, A Ferreira, F Yoshida, N Zhou, F |
author_facet | Miu, A Ferreira, F Yoshida, N Zhou, F |
author_sort | Miu, A |
collection | OXFORD |
description | 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. |
first_indexed | 2024-03-07T08:29:43Z |
format | Conference item |
id | oxford-uuid:c4d46c09-3eb1-40af-9945-0d65591c1736 |
institution | University of Oxford |
language | English |
last_indexed | 2024-03-07T08:29:43Z |
publishDate | 2021 |
publisher | Association for Computing Machinery |
record_format | dspace |
spelling | oxford-uuid:c4d46c09-3eb1-40af-9945-0d65591c17362024-02-28T14:29:17ZCommunication-safe web programming in TypeScript with routed multiparty session typesConference itemhttp://purl.org/coar/resource_type/c_5794uuid:c4d46c09-3eb1-40af-9945-0d65591c1736EnglishSymplectic ElementsAssociation for Computing Machinery2021Miu, AFerreira, FYoshida, NZhou, FModern 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. |
spellingShingle | Miu, A Ferreira, F Yoshida, N Zhou, F Communication-safe web programming in TypeScript with routed multiparty session types |
title | Communication-safe web programming in TypeScript with routed multiparty session types |
title_full | Communication-safe web programming in TypeScript with routed multiparty session types |
title_fullStr | Communication-safe web programming in TypeScript with routed multiparty session types |
title_full_unstemmed | Communication-safe web programming in TypeScript with routed multiparty session types |
title_short | Communication-safe web programming in TypeScript with routed multiparty session types |
title_sort | communication safe web programming in typescript with routed multiparty session types |
work_keys_str_mv | AT miua communicationsafewebprogrammingintypescriptwithroutedmultipartysessiontypes AT ferreiraf communicationsafewebprogrammingintypescriptwithroutedmultipartysessiontypes AT yoshidan communicationsafewebprogrammingintypescriptwithroutedmultipartysessiontypes AT zhouf communicationsafewebprogrammingintypescriptwithroutedmultipartysessiontypes |