Stateful contracts for affine types

  • Authors:
  • Jesse A. Tov;Riccardo Pucella

  • Affiliations:
  • Northeastern University, Boston, MA;Northeastern University, Boston, MA

  • Venue:
  • ESOP'10 Proceedings of the 19th European conference on Programming Languages and Systems
  • Year:
  • 2010

Quantified Score

Hi-index 0.00

Visualization

Abstract

Affine type systems manage resources by preventing some values from being used more than once. This offers expressiveness and performance benefits, but difficulty arises in interacting with components written in a conventional language whose type system provides no way to maintain the affine type system's aliasing invariants. We propose and implement a technique that uses behavioral contracts to mediate between code written in an affine language and code in a conventional typed language. We formalize our approach via a typed calculus with both affine-typed and conventionally-typed modules. We show how to preserve the guarantees of both type systems despite both languages being able to call into each other and exchange higher-order values.