Skip to content
 
 

Latest commit

 

History

19 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Scala with Multiparty Session Types README

  1. User Guide
    • 1.1 Getting Started
    • 1.2 Example Protocols
    • 1.3 Generating Scala Code
    • 1.4 Running Generated Scala Code

1. User Guide

We provide commands and scripts that will allow you to both quickly generate code from the examples, and compile and execute that generated code.


1.1 Getting Started

$ git clone https://github.com/phou/STLab.git
$ cd STLab
$ make
$ make install

You should now have a HsScribble executable in your present working directory.

1.2 Example Protocols

All example protocols can be found in the STLab/scribble directory.


1.3 Generating Scala Code

To generate Scala code from a given Scribble file, Protocol.nuscr, it suffices to run the command:

$ HsScribble -f scribble/Protocol.nuscr -e

This will generate a new file: scala/Protocol.scala.

For example, running

$ HsScribble -f scribble/EVoting.nuscr -e

will result in the output:

Input file name: scribble/EVoting.nuscr
Output Directory: scala/

and will produce scala/EVoting.scala.

Other optional flags are available and can be seen by running:

$ HsScribble -h

The resulting generated code can be found in scala/ directory.


1.4 Running Generated Scala Code

To compile and run generated Scala code, e.g. scala/Protocol.scala, run the runScala.sh script:

$ ./runScala.sh scala/Protocol.scala

This will run the Scala build tool sbt using the provided build.sbt configuration file. Generated code includes a number of print statements that are designed to illustrate the communications behaviour of the given example.

The first time runScala is used, sbt may take additional time to fetch dependencies and compile the Effpi library.

About

DPTP Mich 2023 ST lab

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages