The power of symmetry: unifying inheritance and generative programming

  • Authors:
  • DeLesley Hutchins

  • Affiliations:
  • University of Edinburgh, Edinburgh, UK

  • Venue:
  • OOPSLA '03 Companion of the 18th annual ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications
  • Year:
  • 2003

Quantified Score

Hi-index 0.00

Visualization

Abstract

I present the Ohmu language, a unified object model which allows a number of "advanced" techniques such as aspects, mixin layers, parametric polymorphism, and generative components to be implemented cleanly using two basic concepts: block structure and inheritance. I argue that conventional ways of defining classes and objects have created artificial distinctions which limit their expressiveness. The Ohmu model unifies functions, classes, instances, templates, and even aspects into a single construct - the structure. Function calls, instantiation, aspect-weaving, and inheritance are likewise unified into a single operation - the structure transformation. This simplification eliminates the distinction between classes and instances, and between compile-time and run-time code. Instead of being compiled, programs are reduced using partial evaluation, during which the interpreter is invoked at compile-time. Within this architecture, standard OO inheritance becomes a natural vehicle for creating meta-programs and automatic code generators - the key to a number of recent domain-driven programming methodologies.