License: Creative Commons Attribution 4.0 International license (CC BY 4.0)
When quoting this document, please refer to the following
DOI: 10.4230/LIPIcs.ECOOP.2021.21
URN: urn:nbn:de:0030-drops-140649
URL: https://drops.dagstuhl.de/opus/volltexte/2021/14064/
Go to the corresponding LIPIcs Volume Portal


Servetto, Marco ; Zucca, Elena

λ-Based Object-Oriented Programming (Pearl)

pdf-format:
LIPIcs-ECOOP-2021-21.pdf (0.8 MB)


Abstract

We show that a minimal subset of Java 8 excluding classes supports a simple and natural programming style, which we call λ-based object-oriented programming. That is, on one hand the programmer can use tuples in place of objects (class instances), and tuples can be desugared to lambdas following their classical encoding in the λ-calculus. On the other hand, lambdas can be equipped with additional behaviour, thanks to the fact that they may implement interfaces with default methods, hence inheritance and dynamic dispatch are still supported. We formally describe the encoding by a translation from FJλ, an FJ variant including lambdas and interfaces with default methods, to FJλ-, a subset of FJλ with no classes (hence no constructors and fields). We provide several examples illustrating this novel programming style.

BibTeX - Entry

@InProceedings{servetto_et_al:LIPIcs.ECOOP.2021.21,
  author =	{Servetto, Marco and Zucca, Elena},
  title =	{{\lambda-Based Object-Oriented Programming}},
  booktitle =	{35th European Conference on Object-Oriented Programming (ECOOP 2021)},
  pages =	{21:1--21:16},
  series =	{Leibniz International Proceedings in Informatics (LIPIcs)},
  ISBN =	{978-3-95977-190-0},
  ISSN =	{1868-8969},
  year =	{2021},
  volume =	{194},
  editor =	{M{\o}ller, Anders and Sridharan, Manu},
  publisher =	{Schloss Dagstuhl -- Leibniz-Zentrum f{\"u}r Informatik},
  address =	{Dagstuhl, Germany},
  URL =		{https://drops.dagstuhl.de/opus/volltexte/2021/14064},
  URN =		{urn:nbn:de:0030-drops-140649},
  doi =		{10.4230/LIPIcs.ECOOP.2021.21},
  annote =	{Keywords: Programming paradigms, Java, lambda-calculus}
}

Keywords: Programming paradigms, Java, lambda-calculus
Collection: 35th European Conference on Object-Oriented Programming (ECOOP 2021)
Issue Date: 2021
Date of publication: 06.07.2021


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