Session-ocaml: a session-based library with polarities and lenses
File(s)1-s2.0-S0167642318303289-main.pdf (980.21 KB)
Published version
Author(s)
Imai, K
Yoshida, N
Yuen, S
Type
Journal Article
Abstract
We 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 Image 1 on a number of benchmarks.
Date Issued
2019-03-01
Online Publication Date
2019-03-01
Date Acceptance
2018-08-20
ISSN
0167-6423
Publisher
Elsevier
Start Page
135
End Page
159
Journal / Book Title
Science of Computer Programming
Volume
172
Copyright Statement
©2018TheAuthors.PublishedbyElsevierB.V.ThisisanopenaccessarticleundertheCCBYlicense(http://creativecommons.org/licenses/by/4.0/).
Source Database
manual-entry
Sponsor
Engineering & Physical Science Research Council (E
Engineering & Physical Science Research Council (E
Engineering & Physical Science Research Council (EPSRC)
Commission of the European Communities
Engineering & Physical Science Research Council (EPSRC)
Engineering & Physical Science Research Council (E
Grant Number
ERI 025567 (EP/K034413/1)
PO 1977926
EP/K011715/1
612985
EP/N027833/1
PO 1984726
Subjects
0803 Computer Software
Software Engineering
Publication Status
Published
Date Publish Online
2018-08-30