Chaperones and impersonators: Run-time support for reasonable interposition

T. Stephen Strickland*, Sam Tobin-Hochstadt, Robert Findler, Matthew Flatt

*Corresponding author for this work

Research output: Chapter in Book/Report/Conference proceedingConference contribution

63 Scopus citations

Abstract

Chaperones and impersonators provide run-time support for interposing on primitive operations such as function calls, array access and update, and structure field access and update. Unlike most interposition support, chaperones and impersonators are restricted so that they constrain the behavior of the interposing code to reasonable interposition, which in practice preserves the 2Department of Computer Science University of Massachusetts Amherst, MA, USA 3School of Computer Science University of Waterloo Waterloo, ON, Canadaion mechanisms and reasoning that programmers and compiler analyses rely on. Chaperones and impersonators are particularly useful for implementing contracts, and our implementation in Racket allows us to improve both the expressiveness and the performance of Racket's contract system. Specifically, contracts on mutable data can be enforced without changing the API to that data; contracts on large data structures can be checked lazily on only the accessed parts of the structure; contracts on objects and classes can be implemented with lower overhead; and contract wrappers can preserve object equality where appropriate. With this extension, gradual typing systems, such as Typed Racket, that rely on contracts for interoperation with untyped code can now pass mutable values safely between typed and untyped modules.

Original languageEnglish (US)
Title of host publicationSPLASH 2012
Subtitle of host publicationOOPSLA'12 - Proceedings of the 2012 ACM International Conference on Object Oriented Programming SystemsLanguages and Applications
Pages943-961
Number of pages19
DOIs
StatePublished - 2012
Event2012 ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages, and Applications, OOPSLA 2012 - Tucson, AZ, United States
Duration: Oct 19 2012Oct 26 2012

Publication series

NameProceedings of the Conference on Object-Oriented Programming Systems, Languages, and Applications, OOPSLA

Other

Other2012 ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages, and Applications, OOPSLA 2012
Country/TerritoryUnited States
CityTucson, AZ
Period10/19/1210/26/12

Keywords

  • Contracts
  • Intercession
  • Interposition
  • Proxies

ASJC Scopus subject areas

  • Software

Fingerprint

Dive into the research topics of 'Chaperones and impersonators: Run-time support for reasonable interposition'. Together they form a unique fingerprint.

Cite this