skip to main content
research-article

Virtual values for language extension

Authors Info & Claims
Published:22 October 2011Publication History
Skip Abstract Section

Abstract

This paper focuses on extensibility, the ability of a programmer using a particular language to extend the expressiveness of that language. This paper explores how to provide an interesting notion of extensibility by virtualizing the interface between code and data. A virtual value is a special value that supports behavioral intercession. When a primitive operation is applied to a virtual value, it invokes a trap on that virtual value. A virtual value contains multiple traps, each of which is a user-defined function that describes how that operation should behave on that value. This paper formalizes the semantics of virtual values, and shows how they enable the definition of a variety of language extensions, including additional numeric types; delayed evaluation; taint tracking; contracts; revokable membranes; and units of measure. We report on our experience implementing virtual values for Javascript within an extension for the Firefox browser.

References

  1. T. H. Austin. Proxy values implementation and examples. http://slang.soe.ucsc.edu/proxy-values, 2010.Google ScholarGoogle Scholar
  2. G. Bracha and D. Ungar. Mirrors: design principles for meta-level facilities of object-oriented programming languages. In OOPSLA, pages 331--344, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. R. Cartwright, P.-L. Curien, and M. Felleisen. Fully abstract semantics for observably sequential languages. Inf. Comput., 111(2):297--401, 1994. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. T. V. Cutsem and M. S. Miller. Proxies: Design principles for robust object-oriented intercession APIs. In Dynamic Languages Symposium, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. R. B. Findler and M. Blume. Contracts as pairs of projections. In International Symposium on Functional and Logic Programming, pages 226--241, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. R. B. Findler and M. Felleisen. Contracts for higher-order functions. In Proceedings of the International Conference on Functional Programming, pages 48--59, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. C. Flanagan. Hybrid type checking. In Symposium on Principles of Programming Languages, pages 245 -- 256, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. M. Flatt and PLT. Reference: Racket. Technical Report PLT-TR2010--1, PLT Inc., June 7, 2010. http://racketlang.org/tr1/.Google ScholarGoogle Scholar
  9. A. Gal, B. Eich, M. Shaver, D. Anderson, B. Kaplan, G. Hoare, D. Mandelin, B. Zbarsky, J. Orendorff, M. Bebenita, M. Chang, M. Franz, E. Smith, R. Reitmaier, and M. Haghighat. Trace-based just-in-time type specialization for dynamic languages. In PLDI, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. E. Gamma, R. Helm, R. Johnson, and J. Vlissides. Design Patterns. Addison-Wesley, Boston, MA, 1995.Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. A. Goldberg and D. Robson. Smalltalk-80: the language and its implementation. Addison-Wesley Longman Publishing Co., Inc., Boston, MA, USA, 1983. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. K. E. Gray, R. B. Findler, and M. Flatt. Fine-grained interoperability through mirrors and contracts. In OOPSLA, pages 231--245, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. A. Kennedy. Relational parametricity and units of measure. In Principles of Programming Languages, pages 442--455, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. G. Kiczales. Aspect-oriented programming. ACM Comput. Surv., page 154, 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. G. Kiczales, J. D. Rivieres, and D. G. Bobrow. The Art of the Metaobject Protocol. The MIT Press, July 1991. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. L. A. Meyerovich, A. P. Felt, and M. S. Miller. Object views: Fine-grained sharing in browsers. In Proceedings of the WWW 2010, Raleigh NC, USA, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. M. S. Miller. Robust Composition: Towards a Unified Approach to Access Control and Concurrency Control. PhD thesis, Johns Hopkins University, Baltimore, Maryland, USA, May 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. M. S. Miller and T. V. Cutsem. Catch-all proxies. http:// wiki.ecmascript.org/doku.php?id=harmony:proxies.Google ScholarGoogle Scholar
  19. M. S. Miller, E. D. Tribble, and J. Shapiro. Concurrency among strangers: Programming in E as plan coordination. In In Trustworthy Global Computing, International Symposium, TGC 2005, pages 195--229. Springer, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. S. Mostinckx, T. V. Cutsem, S. Timbermont, E. G. Boix, É. Tanter, and W. D. Meuter. Mirror-based reflection in AmbientTalk. Softw., Pract. Exper., 39(7):661--699, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. Mozilla labs: Zaphod add-on for the firefox browser. http://mozillalabs.com/zaphod, accessed October 2010.Google ScholarGoogle Scholar
  22. Paul Hudak and Simon Peyton-Jones and Philip Wadler (eds.). Report on the programming language Haskell: A non-strict, purely functional language version 1.2. SIGPLAN Notices, 27(5), 1992. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. J. Siek and W. Taha. Gradual typing for objects. In European Conference on Object Oriented Programming, pages 2--27, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. J. G. Siek and P. Wadler. Threesomes, with and without blame. In POPL, pages 365--376, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. Wikipedia: Narcissus JavaScript engine. http://en.wikipedia.org/wiki/ Narcissus_(JavaScript_engine), accessed October 2010.Google ScholarGoogle Scholar

Index Terms

  1. Virtual values for language extension

      Recommendations

      Comments

      Login options

      Check if you have access through your login credentials or your institution to get full access on this article.

      Sign in

      Full Access

      • Published in

        cover image ACM SIGPLAN Notices
        ACM SIGPLAN Notices  Volume 46, Issue 10
        OOPSLA '11
        October 2011
        1063 pages
        ISSN:0362-1340
        EISSN:1558-1160
        DOI:10.1145/2076021
        Issue’s Table of Contents
        • cover image ACM Conferences
          OOPSLA '11: Proceedings of the 2011 ACM international conference on Object oriented programming systems languages and applications
          October 2011
          1104 pages
          ISBN:9781450309400
          DOI:10.1145/2048066

        Copyright © 2011 ACM

        Publisher

        Association for Computing Machinery

        New York, NY, United States

        Publication History

        • Published: 22 October 2011

        Check for updates

        Qualifiers

        • research-article

      PDF Format

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader
      About Cookies On This Site

      We use cookies to ensure that we give you the best experience on our website.

      Learn more

      Got it!