This repository hosts the source code for STScript, a toolchain for communication-safe web development in TypeScript with Routed Multiparty Session Types.
This is an anonymised pre-artifact accompanying the CGO paper submission. A final artifact will be submitted for evaluation upon paper acceptance.
mpst_ts/
directory contains the code generation
toolchain which generates TypeScript APIs
from a Scribble protocol speciication.
You can build the development environment via
chmod +x build.sh
./build.sh
and enter the development environment with
docker-compose up -d
docker-compose exec codegen bash
To exit the development environment, open a separate terminal window and run
docker-compose down
These commands only work inside the development environment.
To generate code for server-side (Node.js) endpoints, run
./stscript.sh PATH_TO_PROTOCOL PROTOCOL ROLE node
e.g.
./stscript.sh protocols/Adder.scr Adder Svr node
The APIs will be generated under sandbox/node/
.
To generate code for browser-side (React.js) endpoints, run
./stscript.sh PATH_TO_PROTOCOL PROTOCOL ROLE browser -s SERVER_ROLE
e.g.
./stscript.sh protocols/Adder Adder Client browser -s Svr
The APIs will be generated under sandbox/browser/
.
To test that STScript generates APIs that type-check against the TypeScript Compiler, run
./test.sh
protocols/
directory contains Scribble
protocols for a range of web services, including
the case studies discussed in § 5.2 and the
running example motivated in § 1.
case-studies/
directory contains the source
code for the interactive web applications implemented in § 5.2 -- refer to the README in the directory for how to run the examples.
benchmarks/
directory contains the performance
micro-benchmarks discussed in § 5.1 -- refer to the README
in the directory for how to run the benchmark and
visualise the results.
The authors can be reached at stscript2020_gmail.com (replace _ with @).