[go: up one dir, main page]
More Web Proxy on the site http://driver.im/ skip to main content
research-article

Chaperones and impersonators: run-time support for reasonable interposition

Published: 19 October 2012 Publication History

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 abstraction 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.

Supplementary Material

ZIP File (res0133.zip)
This contains the technical appendices from the paper. See the included index.html file for more information.

References

[1]
Jonathan Aldrich. Open Modules: Modular Reasoning About Ad-vice. In Proc. European Conf. Object-Oriented Programming, 2005.
[2]
Thomas H. Austin, Tim Disney, and Cormac Flanagan. Virtual Values for Language Extension. In Proc. ACM Conf. Object-Oriented Programming, Systems, Languages and Applications, 2011.
[3]
Stephanie Balzer, Patrick Eugster, and Bertrand Meyer. Can Aspects Implement Contracts? In Proc. Rapid Implemetation of Software Engineering Techniques, pp. 145--157, 2005.
[4]
Olaf Chitil. Practical Typed Lazy Contracts. In Proc. ACM Intl. Conf. Functional Programming, 2012.
[5]
Olaf Chitil and Frank Huch. A pattern logic for prompt lazy asser-tions. In Proc. Intl. Sym. Functional and Logic Programming, pp. 126--144, 2006.
[6]
Olaf Chitil, Dan McNeill, and Colin Runciman. Lazy Assertions. In Proc. Intl. Sym. Functional and Logic Programming, 2003.
[7]
Curtis Clifton and Gary T. Leavens. Observers and assistants: A proposal for modular aspect-oriented reasoning. In Proc. Foundations of Aspect-Oriented Languages, 2002.
[8]
Daniel S. Dantas and David Walker. Harmless Advice. In Proc. ACM Sym. Principles of Programming Languages, 2006.
[9]
Jessie Dedecker, Tom Van Cutsem, Stijn Mostinckx, Theo D'Hondt, and Wolfgang De Meuter. Ambient-Oriented Programming. In Proc. ACM Conf. Object-Oriented Programming, Systems, Languages and Applications, pp. 31--40, 2005.
[10]
Digital Mars. D Programming Language. 1999. http://www.digitalmars.com/d/
[11]
Tim Disney. Contracts.coffee. 2012. http://disnetdev.com/contracts.coffee/
[12]
James E. Donnelley. A distributed capability computing system. In Proc. Intl. Conf. on Computer Communication, 1976.
[13]
Pedro Felzenszwalb and David McAllester. A min-cover approach for finding salient curves. In Proc. IEEE Wksp. Perceptual Organization in Computer Vision, 2006.
[14]
Robert Bruce Findler andMatthias Felleisen. Contracts for Higher-Order Functions. In Proc. ACM Intl. Conf. Functional Programming, pp. 48--59, 2002.
[15]
Robert Bruce Findler, Shu-yu Guo, and Anne Rogers. Lazy Contract Checking for Immutable Data Structures. In Proc. Implementation and Application of Functional Languages, 2007.
[16]
Matthew Flatt and PLT. Reference: Racket. PLT Inc., PLT-TR-2010-1, 2010. http://racket-lang.org/tr1/
[17]
Brian Hackett and Shu-Yu Guo. Fast and precise type inference for JavaScript. In Proc. Conf. on Programming Language Design and Implementation, 2012.
[18]
Ralf Hinze, Johan Jeuring, and Andres Löh. Typed Contracts for Functional Programming. In Proc. Sym. Functional and Logic Programming, pp. 208--225, 2006.
[19]
Gregor Kiczales, John Lamping, Anurag Mendhekar, Chris Maeda, Cristina Lopes, Jean-Marc Loingtier, and John Irwin. Aspect-Oriented Programming. In Proc. European Conf. Object-Oriented Programming, pp. 220--242, 1997.
[20]
Gregor J. Kiczales, James des Rivieres, and Daniel G. Bobrow. The Art of the Metaobject Protocol. MIT Press, 1991.
[21]
B. W. Lampson, J. J. Horning, R. L. London, J. G. Mitchell, and G. J. Popek. Report on the programming language Euclid. ACM SIGPLAN Notices 12(2), pp. 1--79, 1977.
[22]
D. C. Luckham and F. W. von Henke. An overview of Anna, a specification language for Ada. IEEE Software 2(2), pp. 9--22, 1985.
[23]
Jacob Matthews and Amal Ahmed. Parametric Polymorphism Through Run-Time Sealing, or, Theorems for Low, Low Prices! In Proc. European Sym. on Programming, 2008.
[24]
E. Mera, P. Lopez-Garcia, and M. Hermenegildo. Integrating Software Testing and Run-Time Checking in an Assertion Verification Framework. In Proc. Intl. Conf. on Logic Programming, LNCS 5649, 2009.
[25]
Bertrand Meyer. Eiffel : The Language. Prentice Hall PTR, 1991.
[26]
Mark S. Miller. Robust Composition: Towards a Unified Approach to Access Control and Concurrency Control. PhD dissertation, John Hopkins University, 2006.
[27]
Stijn Mostinckx, Tom Van Cutsem, Elisa Gonzalez Boix, Stijn Timbermont, Éric Tanter, and Wolfgang De Meuter. Mirror-based reflection in AmbientTalk. Software-Practice and Experience 39, pp. 661--699, 2009.
[28]
Toby Murray. Analysing the Security Properties of Object-Capability Patterns. PhD dissertation, Hertford College, Oxford University, 2010.
[29]
Bruno C. d. S. Oliveira, Tom Schrijvers, and William R. Cook. Effective Advice: Disciplined Advice with Explicit Effects. In Proc. Aspect-Oriented Software Development, 2010.
[30]
Oracle. java.lang.reflect.Proxy. 2000. http://download.oracle.com/javase/6/docs/api/java/lang/reflect/Proxy.html
[31]
Susan A. Rajunas. The KeyKOS/KeySAFE system design. Key Logic, Inc, SEC009-01, 1989. http://www.cis.upenn.edu/~KeyKOS
[32]
Martin Rinard, Alexandru Salcianu, and Suhabe Bugrara. A Classification System and Analysis for Aspect-Oriented Programs. In Proc. Intl. Sym. on the Foundations of Software Engineering, 2004.
[33]
T. Stephen Strickland and Matthias Felleisen. Contracts for First-Class Classes. In Proc. Dynamic Languages Symposium, pp. 97--112, 2010.
[34]
Sam Tobin-Hochstadt and Matthias Felleisen. The Design and Implementation of Typed Scheme. In Proc. ACM Sym. Principles of Programming Languages, pp. 395--406, 2008.
[35]
Tom Van Cutsem and Mark Miller. Proxies: Design Principles for Robust Object-oriented Intercession APIs. In Proc. Dynamic Languages Symposium, pp. 59--72, 2010.
[36]
Tom Van Cutsem and Mark Miller. On the design of the ECMAScript Reflection API. Vrije Universiteit Brussel, VUB-SOFT-TR-12-03, 2012.

Cited By

View all
  • (2023)Typed–Untyped Interactions: A Comparative AnalysisACM Transactions on Programming Languages and Systems10.1145/357983345:1(1-54)Online publication date: 5-Mar-2023
  • (2021)Sound and Complete Concolic Testing for Higher-order FunctionsProgramming Languages and Systems10.1007/978-3-030-72019-3_23(635-663)Online publication date: 23-Mar-2021
  • (2020)Dynamic property caches: a step towards faster JavaScript proxy objectsProceedings of the 29th International Conference on Compiler Construction10.1145/3377555.3377888(108-118)Online publication date: 22-Feb-2020
  • Show More Cited By

Index Terms

  1. Chaperones and impersonators: run-time support for reasonable interposition

    Recommendations

    Comments

    Please enable JavaScript to view thecomments powered by Disqus.

    Information & Contributors

    Information

    Published In

    cover image ACM SIGPLAN Notices
    ACM SIGPLAN Notices  Volume 47, Issue 10
    OOPSLA '12
    October 2012
    1011 pages
    ISSN:0362-1340
    EISSN:1558-1160
    DOI:10.1145/2398857
    Issue’s Table of Contents
    • cover image ACM Conferences
      OOPSLA '12: Proceedings of the ACM international conference on Object oriented programming systems languages and applications
      October 2012
      1052 pages
      ISBN:9781450315616
      DOI:10.1145/2384616
    Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

    Publisher

    Association for Computing Machinery

    New York, NY, United States

    Publication History

    Published: 19 October 2012
    Published in SIGPLAN Volume 47, Issue 10

    Check for updates

    Author Tags

    1. contracts
    2. intercession
    3. interposition
    4. proxies

    Qualifiers

    • Research-article

    Contributors

    Other Metrics

    Bibliometrics & Citations

    Bibliometrics

    Article Metrics

    • Downloads (Last 12 months)7
    • Downloads (Last 6 weeks)3
    Reflects downloads up to 10 Dec 2024

    Other Metrics

    Citations

    Cited By

    View all
    • (2023)Typed–Untyped Interactions: A Comparative AnalysisACM Transactions on Programming Languages and Systems10.1145/357983345:1(1-54)Online publication date: 5-Mar-2023
    • (2021)Sound and Complete Concolic Testing for Higher-order FunctionsProgramming Languages and Systems10.1007/978-3-030-72019-3_23(635-663)Online publication date: 23-Mar-2021
    • (2020)Dynamic property caches: a step towards faster JavaScript proxy objectsProceedings of the 29th International Conference on Compiler Construction10.1145/3377555.3377888(108-118)Online publication date: 22-Feb-2020
    • (2018)Collapsible contracts: fixing a pathology of gradual typingProceedings of the ACM on Programming Languages10.1145/32765032:OOPSLA(1-27)Online publication date: 24-Oct-2018
    • (2018)A spectrum of type soundness and performanceProceedings of the ACM on Programming Languages10.1145/32367662:ICFP(1-32)Online publication date: 30-Jul-2018
    • (2017)Stateful manifest contractsACM SIGPLAN Notices10.1145/3093333.300987552:1(530-544)Online publication date: 1-Jan-2017
    • (2017)Stateful manifest contractsProceedings of the 44th ACM SIGPLAN Symposium on Principles of Programming Languages10.1145/3009837.3009875(530-544)Online publication date: 1-Jan-2017
    • (2016)Oh Lord, please don't let contracts be misunderstood (functional pearl)ACM SIGPLAN Notices10.1145/3022670.295193051:9(117-131)Online publication date: 4-Sep-2016
    • (2016)Oh Lord, please don't let contracts be misunderstood (functional pearl)Proceedings of the 21st ACM SIGPLAN International Conference on Functional Programming10.1145/2951913.2951930(117-131)Online publication date: 4-Sep-2016
    • (2016)Higher order symbolic execution for contract verification and refutationJournal of Functional Programming10.1017/S095679681600021627Online publication date: 21-Dec-2016
    • Show More Cited By

    View Options

    Login options

    View options

    PDF

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader

    Media

    Figures

    Other

    Tables

    Share

    Share

    Share this Publication link

    Share on social media