Encoding ownership types in java

  • Authors:
  • Nicholas Cameron;James Noble

  • Affiliations:
  • Victoria University of Wellington, New Zealand;Victoria University of Wellington, New Zealand

  • Venue:
  • TOOLS'10 Proceedings of the 48th international conference on Objects, models, components, patterns
  • Year:
  • 2010

Quantified Score

Hi-index 0.00

Visualization

Abstract

Ownership types systems organise the heap into a hierarchy which can be used to support encapsulation properties, effects, and invariants. Ownership types have many applications including parallelisation, concurrency, memory management, and security. In this paper, we show that several flavours and extensions of ownership types can be entirely encoded using the standard Java type system. Ownership types systems usually require a sizable effort to implement and the relation of ownership types to standard type systems is poorly understood. Our encoding demonstrates the connection between ownership types and parametric and existential types. We formalise our encoding using a model for Java's type system, and prove that it is sound and enforces an ownership hierarchy. Finally, we leverage our encoding to produce lightweight compilers for Ownership Types and Universe Types -- each compiler took only one day to implement.