Last active
October 16, 2022 19:35
-
-
Save jfdm/074cec5d4aee4cfa5ca496cad97eda81 to your computer and use it in GitHub Desktop.
Projection of Session Types in Ola (and we have a REPL)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ 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