Skip to content

Instantly share code, notes, and snippets.

@jfdm
Last active October 16, 2022 19:35
Show Gist options
  • Save jfdm/074cec5d4aee4cfa5ca496cad97eda81 to your computer and use it in GitHub Desktop.
Save jfdm/074cec5d4aee4cfa5ca496cad97eda81 to your computer and use it in GitHub Desktop.
Projection of Session Types in Ola (and we have a REPL)
role Alice
role Bob
type foo = String
protocol pingpong = Alice ==> Bob { ping(String)
. Bob ==> Alice { pong(String)
. end }}
main()
{
print("My First Program");
return unit;
}
$ rlwrap ./build/exec/ola --repl
Ola> :l tests/examples/006-sessions/main.ola
# Finished Parsing
# Finished Type Checking
Ola> :project pingpong Bob
(Branch (RoleVar 1) ping(STR) => (Select (RoleVar 1) pong(STR) => End))
Ola> :project pingpong Alice
(Select (RoleVar 0) ping(STR) => (Branch (RoleVar 0) pong(STR) => End))
Ola> :q
Quitting
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment