License: Creative Commons Attribution 3.0 Unported license (CC BY 3.0)
When quoting this document, please refer to the following
DOI: 10.4230/LIPIcs.ECOOP.2016.21
URN: urn:nbn:de:0030-drops-61156
URL: http://dagstuhl.sunsite.rwth-aachen.de/volltexte/2016/6115/
Go to the corresponding LIPIcs Volume Portal


Scalas, Alceste ; Yoshida, Nobuko

Lightweight Session Programming in Scala

pdf-format:
LIPIcs-ECOOP-2016-21.pdf (1 MB)


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.

BibTeX - Entry

@InProceedings{scalas_et_al:LIPIcs:2016:6115,
  author =	{Alceste Scalas and Nobuko Yoshida},
  title =	{{Lightweight Session Programming in Scala}},
  booktitle =	{30th European Conference on Object-Oriented Programming (ECOOP 2016)},
  pages =	{21:1--21:28},
  series =	{Leibniz International Proceedings in Informatics (LIPIcs)},
  ISBN =	{978-3-95977-014-9},
  ISSN =	{1868-8969},
  year =	{2016},
  volume =	{56},
  editor =	{Shriram Krishnamurthi and Benjamin S. Lerner},
  publisher =	{Schloss Dagstuhl--Leibniz-Zentrum fuer Informatik},
  address =	{Dagstuhl, Germany},
  URL =		{http://drops.dagstuhl.de/opus/volltexte/2016/6115},
  URN =		{urn:nbn:de:0030-drops-61156},
  doi =		{10.4230/LIPIcs.ECOOP.2016.21},
  annote =	{Keywords: session types, Scala, concurrency}
}

Keywords: session types, Scala, concurrency
Collection: 30th European Conference on Object-Oriented Programming (ECOOP 2016)
Issue Date: 2016
Date of publication: 18.07.2016


DROPS-Home | Fulltext Search | Imprint | Privacy Published by LZI