TY - GEN
T1 - Chaperones and impersonators
T2 - 2012 ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages, and Applications, OOPSLA 2012
AU - Strickland, T. Stephen
AU - Tobin-Hochstadt, Sam
AU - Findler, Robert
AU - Flatt, Matthew
PY - 2012
Y1 - 2012
N2 - 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.
AB - 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.
KW - Contracts
KW - Intercession
KW - Interposition
KW - Proxies
UR - http://www.scopus.com/inward/record.url?scp=84869751528&partnerID=8YFLogxK
UR - http://www.scopus.com/inward/citedby.url?scp=84869751528&partnerID=8YFLogxK
U2 - 10.1145/2384616.2384685
DO - 10.1145/2384616.2384685
M3 - Conference contribution
AN - SCOPUS:84869751528
SN - 9781450315616
T3 - Proceedings of the Conference on Object-Oriented Programming Systems, Languages, and Applications, OOPSLA
SP - 943
EP - 961
BT - SPLASH 2012
Y2 - 19 October 2012 through 26 October 2012
ER -