links-lang / links

Links: Linking Theory to Practice for the Web
http://www.links-lang.org
Other
318 stars 42 forks source link

Untypesettable session types #1180

Open dhil opened 1 year ago

dhil commented 1 year ago

The pretty printer emits session types that cannot be typesetted by the programmer, e.g.

links> fun mkChan() { fork(fun(ch) { var ch = send(42, ch); close(ch) }) };
mkChan = fun : () ~> ~!(Int).End
links> sig mkChan : () ~> ~!(Int).End fun mkChan() { fork(fun(ch) { var ch = send(42, ch); close(ch) }) };
***: Parse error: <stdin>:1

  sig mkChan : () ~> ~!(Int).End fun mkChan() { fork(fun(ch) { var ch = send(42, ch); close(ch) }) };
                       ^
links> sig mkChan : () ~> ~(!(Int).End) fun mkChan() { fork(fun(ch) { var ch = send(42, ch); close(ch) }) };
mkChan = fun : () ~> ~(!(Int).End)