A prototypical Java-like language with records and traits

  • Authors:
  • Lorenzo Bettini;Ferruccio Damiani;Ina Schaefer;Fabio Strocco

  • Affiliations:
  • Università di Torino, Torino, Italy;Università di Torino, Torino, Italy;Chalmers University of Technology, Gothenburg, Sweden;Università di Torino, Torino, Italy

  • Venue:
  • Proceedings of the 8th International Conference on the Principles and Practice of Programming in Java
  • Year:
  • 2010

Quantified Score

Hi-index 0.00

Visualization

Abstract

Traits have been designed as units of fine-grained behavior reuse in the object-oriented paradigm. In this paper, we present the language Sugared Welterweight Record-Trait Java (SWRTJ), a Java dialect with records and traits. Records have been devised to complement traits for fine-grained state reuse. Records and traits can be composed by explicit linguistic operations, allowing code manipulations to achieve fine-grained code reuse. Classes are assembled from (composite) records and traits and instantiated to generate objects. We present the prototypical implementation of SWRTJ using Xtext, an Eclipse framework for the development of programming languages as well as other domain-specific languages. Our implementation comprises an Eclipse-based editor for SWRTJ with typical IDE functionalities, and a stand-alone compiler, which translates SWRTJ programs into standard Java programs.