Spores: A Type-Based Foundation for Closures in the Age of Concurrency and Distribution
2014 (English)In: ECOOP 2014: Proceedings of the 28th European Conference on Object-Oriented Programming, 2014, Vol. 8586, 308-333 p.Conference paper (Refereed)
Functional programming (FP) is regularly touted as the way forward for bringing parallel, concurrent, and distributed programming to the mainstream. The popularity of the rationale behind this viewpoint has even led to a number of object-oriented (OO) programming languages outside the Smalltalk tradition adopting functional features such as lambdas and thereby function closures. However, despite this established viewpoint of FP as an enabler, reliably distributing function closures over a network, or using them in concurrent environments nonetheless remains a challenge across FP and OO languages. This paper takes a step towards more principled distributed and concurrent programming by introducing a new closure-like abstraction and type system, called spores, that can guarantee closures to be serializable, thread-safe, or even have custom user-defined properties. Crucially, our system is based on the principle of encoding type information corresponding to captured variables in the type of a spore. We prove our type system sound, implement our approach for Scala, evaluate its practicality through a small empirical study, and show the power of these guarantees through a case analysis of real-world distributed and concurrent frameworks that this safe foundation for closures facilitates.
Place, publisher, year, edition, pages
2014. Vol. 8586, 308-333 p.
, Lecture Notes in Computer Science (including subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics), ISSN 03029743
IdentifiersURN: urn:nbn:se:kth:diva-165677DOI: 10.1007/978-3-662-44202-9_13ScopusID: 2-s2.0-84905370750ISBN: 978-366244201-2OAI: oai:DiVA.org:kth-165677DiVA: diva2:808740
2014 European Conference on Object-Oriented Programming, Uppsala, Sweden, July 28 - August 1, 2014
QC 201505182015-04-292015-04-292015-05-18Bibliographically approved