Lightweight Session Programming in Scala
File(s)LIPIcs-ECOOP-2016-21.pdf (1.79 MB)
Published version
Author(s)
Scalas, A
Yoshida, N
Type
Conference Paper
Abstract
Designing, developing and maintaining concurrent applications is an error-prone and time-consuming task; most difficulties arise because compilers are usually unable to check whether the inputs/outputs performed by a program at runtime will adhere to a given protocol specification. To address this problem, we propose lightweight session programming in Scala: we leverage the native features of the Scala type system and standard library, to introduce (1) a representation of session types as Scala types, and (2) a library, called lchannels, with a convenient API for session-based programming, supporting local and distributed communication. We generalise the idea of Continuation-Passing Style Protocols (CPSPs), studying their formal relationship with session types. We illustrate how session programming can be carried over in Scala: how to formalise a communication protocol, and represent it using Scala classes and lchannels, letting the compiler help spotting protocol violations. We attest the practicality of our approach with a complex use case, and evaluate the performance of lchannels with a series of benchmarks.
Date Issued
2016-07-17
Date Acceptance
2016-04-22
Citation
Leibniz International Proceedings in Informatics, LIPIcs, 2016, 56, pp.21:1-21:28
ISBN
9783959770149
ISSN
1868-8969
Publisher
Schloss Dagstuhl - Leibniz-Zentrum fuer Informatik
Start Page
21:1
End Page
21:28
Journal / Book Title
Leibniz International Proceedings in Informatics, LIPIcs
Volume
56
Copyright Statement
Licensed under Creative Commons License CC-BY
Sponsor
Engineering & Physical Science Research Council (E
Engineering & Physical Science Research Council (E
Engineering & Physical Science Research Council (EPSRC)
Commission of the European Communities
Grant Number
ERI 025567 (EP/K034413/1)
PO 1553380
EP/K011715/1
612985
Source
30th European Conference on Object-Oriented Programming (ECOOP 2016)
Publication Status
Published
Start Date
2016-07-17
Finish Date
2016-07-22
Coverage Spatial
Rome, Italy
OA Location
http://drops.dagstuhl.de/opus/volltexte/2016/6115/pdf/LIPIcs-ECOOP-2016-21.pdf