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.shand enter the development environment with
docker-compose up -d
docker-compose exec codegen bashTo exit the development environment, open a separate terminal window and run
docker-compose downThese commands only work inside the development environment.
To generate code for server-side (Node.js) endpoints, run
./stscript.sh PATH_TO_PROTOCOL PROTOCOL ROLE nodee.g.
./stscript.sh protocols/Adder.scr Adder Svr nodeThe 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_ROLEe.g.
./stscript.sh protocols/Adder Adder Client browser -s SvrThe APIs will be generated under sandbox/browser/.
To test that STScript generates APIs that type-check against the TypeScript Compiler, run
./test.shprotocols/ 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 @).