Lightweight session programming in scala

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.

Publication DOI: https://doi.org/10.4230/DARTS.2.1.11
Divisions: College of Engineering & Physical Sciences
Funding Information: Work partly supported by: EPSRC EP/K011715/1, EP/K034413/1 and EP/L00058X/1, and EU project FP7-612985 UpScale.
Additional Information: © Alceste Scalas and Nobuko Yoshida; licensed under Creative Commons License CC-BY Funding: Work partly supported by: EPSRC EP/K011715/1, EP/K034413/1 and EP/L00058X/1, and EU project FP7-612985 UpScale.
Event Title: 30th European Conference on Object-Oriented Programming, ECOOP 2016
Event Type: Other
Event Dates: 2016-07-18 - 2016-07-22
Uncontrolled Keywords: Concurrency,Scala,Session types,Software
ISBN: 9783959770149
Last Modified: 12 Feb 2024 08:02
Date Deposited: 17 Jun 2019 15:29
Full Text Link:
Related URLs: http://www.scop ... tnerID=8YFLogxK (Scopus URL)
PURE Output Type: Conference contribution
Published Date: 2016-07-22
Accepted Date: 2016-07-01
Authors: Scalas, Alceste (ORCID Profile 0000-0002-1153-6164)
Yoshida, Nobuko

Download

[img]

Version: Published Version

License: Creative Commons Attribution

| Preview

Export / Share Citation


Statistics

Additional statistics for this record