A Programmer's Reduction Semantics for Classes and Mixins

  • Authors:
  • Matthew Flatt;Shriram Krishnamurthi;Matthias Felleisen

  • Affiliations:
  • -;-;-

  • Venue:
  • Formal Syntax and Semantics of Java
  • Year:
  • 1999

Quantified Score

Hi-index 0.00

Visualization

Abstract

While class-based object-oriented programming languages provide a flexible mechanism for re-using and managing related pieces of code, they typically lack linguistic facilities for specifying a uniform extension of many classes with one set of fields and methods. As a result, programmers are unable to express certain abstractions over classes. In this paper we develop a model of class-to-class functions that we refer to as mixins. A mixin function maps a class to an extended class by adding or overriding fields and methods. Programming with mixins is similar to programming with single inheritance classes, but mixins more directly encourage programming to interfaces. The paper develops these ideas within the context of Java. The results are 1. an intuitive model of an essential Java subset; 2. an extension that explains and models mixins; and 3. type soundness theorems for these languages.