Session-ocaml: A session-based library with polarities and lenses
2018; Elsevier BV; Volume: 172; Linguagem: Inglês
10.1016/j.scico.2018.08.005
ISSN1872-7964
AutoresKeigo Imai, Nobuko Yoshida, Shoji Yuen,
Tópico(s)Distributed systems and fault tolerance
ResumoWe propose session-ocaml, a novel library for session-typed concurrent/distributed programming in OCaml. Our technique solely relies on parametric polymorphism, which can encode core session type structures with strong static guarantees. Our key ideas are: (1) polarised session types, which give an alternative formulation of duality enabling OCaml to automatically infer an appropriate session type in a session with a reasonable notational overhead; and (2) a parameterised monad with a data structure called 'slots' manipulated with lenses, which can statically enforce session linearity including delegations. We introduce a notational extension to enhance the session linearity for integrating the session types into the functional programming style. We show applications of session-ocaml to a travel agency use case and an SMTP protocol implementation. Furthermore, we evaluate the performance of on a number of benchmarks.
Referência(s)