[go: up one dir, main page]
More Web Proxy on the site http://driver.im/ skip to main content
10.1145/3009837.3009849acmconferencesArticle/Chapter ViewAbstractPublication PagespoplConference Proceedingsconference-collections
research-article
Public Access

Big types in little runtime: open-world soundness and collaborative blame for gradual type systems

Published: 01 January 2017 Publication History

Abstract

Gradual typing combines static and dynamic typing in the same language, offering programmers the error detection and strong guarantees of static types and the rapid prototyping and flexible programming idioms of dynamic types. Many gradually typed languages are implemented by translation into an untyped target language (e.g., Typed Clojure, TypeScript, Gradualtalk, and Reticulated Python). For such languages, it is desirable to support arbitrary interaction between translated code and legacy code in the untyped language while maintaining the type soundness of the translated code. In this paper we formalize this goal in the form of the open-world soundness criterion. We discuss why it is challenging to achieve open-world soundness using the traditional proxy-based approach for higher-order casts. However, the transient design satisfies open-world soundness. Indeed, we present a formal semantics for the transient design and prove that our semantics satisfies open-world soundness. In this paper we also solve a challenging problem for the transient design: how to provide blame tracking without proxies. We define a semantics for blame and prove the Blame Theorem. We also prove that the Gradual Guarantee holds for this system, ensuring that programs can be evolved freely between static and dynamic typing. Finally, we demonstrate that the runtime overhead of the transient approach is low in the context of Reticulated Python, an implementation of gradual typing for Python.

References

[1]
M. Abadi, L. Cardelli, B. Pierce, and G. Plotkin. Dynamic typing in a statically-typed language. In POPL, 1989.
[2]
Amal Ahmed, Robert Bruce Findler, Jeremy G. Siek, and Philip Wadler. Blame for all. In POPL, 2011.
[3]
Esteban Allende, Oscar Calla´u, Johan Fabry, Éric Tanter, and Markus Denker. Gradual typing for smalltalk. Science of Computer Programming, August 2013.
[4]
Esteban Allende, Johan Fabry, and Éric Tanter. Cast insertion strategies for gradually-typed objects. In DLS, 2013.
[5]
Christopher Anderson and Sophia Drossopoulou. BabyJ - from object based to class based programming via types. In Workshop on Object Oriented Developments, 2003.
[6]
Andrew W. Appel. Compiling with Continuations. Cambridge University Press, New York, NY, USA, 2007.
[7]
Gavin Bierman, Erik Meijer, and Mads Torgersen. In ECOOP. Springer-Verlag.
[8]
Bard Bloom, John Field, Nathaniel Nystrom, Johan Östlund, Gregor Richards, Rok Strniˇsa, Jan Vitek, and Tobias Wrigstad. Thorn: Robust, concurrent, extensible scripting on the jvm. In OOPSLA, 2009.
[9]
Ambrose Bonnaire-Sergeant, Rowan Davies, and Sam Tobin-Hochstad. Practical optional types for clojure. In ESOP, 2016.
[10]
Gilad Bracha and David Griswold. Strongtalk: Typechecking smalltalk in a production environment. In OOPSLA, New York, NY, USA, 1993. ACM.
[11]
Robert Cartwright. User-defined data types as an aid to verifying LISP programs. In ICALP, 1976.
[12]
Craig Chambers and the Cecil Group. The Cecil language: Specification and rationale. Technical report, Department of Computer Science and Engineering, University of Washington, Seattle, Washington, 2004.
[13]
Christos Dimoulas, Robert Bruce Findler, Cormac Flanagan, and Matthias Felleisen. Correct blame for contracts: no more scapegoating. In POPL, 2011.
[14]
Christos Dimoulas, Sam Tobin-Hochstadt, and Matthias Felleisen. Complete monitors for behavioral contracts. In ESOP, 2012.
[15]
Eiffel. The Power of Design by Contract.
[16]
Facebook. Hack, 2013.
[17]
Robert Bruce Findler and Matthias Blume. Contracts as pairs of projections. In FLOPS, 2006.
[18]
Robert Bruce Findler and Matthias Felleisen. Contracts for higherorder functions. In ICFP, 2002.
[19]
Cormac Flanagan. Hybrid type checking. In POPL, Charleston, South Carolina, 2006.
[20]
Google. Dart: structured web apps, 2011.
[21]
Kathryn E. Gray, Robert Bruce Findler, and Matthew Flatt. Finegrained interoperability through mirrors and contracts. In OOPSLA. ACM Press, 2005.
[22]
Robert Harper. Practical Foundations for Programming Languages. Cambridge University Press, New York, NY, USA, 2012.
[23]
David Herman, Aaron Tomb, and Cormac Flanagan. Space-efficient gradual typing. In Trends in Functional Programming, 2007.
[24]
Matthias Keil and Peter Thiemann. Blame assignment for higher-order contracts with intersection and union. In ICFP, 2015.
[25]
Matthias Keil and Peter Thiemann. Transparent object proxies in JavaScript. In ECOOP, 2015.
[26]
Gianluca Mezzetti, Anders Møller, and Fabio Strocco. Type unsoundness in practice: An empirical study of Dart. In DLS, 2016.
[27]
Microsoft. Typescript, 2012.
[28]
Aseem Rastogi, Avik Chaudhuri, and Basil Hosmer. The ins and outs of gradual type inference. In POPL, 2012.
[29]
Aseem Rastogi, Nikhil Swamy, Cedric Fournet, Gavin Bierman, and Panagiotis Vekris. Safe & efficient gradual typing for TypeScript. Technical Report MSR-TR-2014-99, Microsoft Research, 2014.
[30]
Brianna M. Ren, John Toman, T. Stephen Strickland, and Jeffrey S. Foster. The ruby type checker. In Symposium on Applied Computing, 2013.
[31]
Gregor Richards, Francesco Zappa Nardelli, and Jan Vitek. Concrete Types for TypeScript. In ECOOP, 2015.
[32]
Manuel Serrano. Bigloo: a practical Scheme compiler. Inria-Rocquencourt, April 2002.
[33]
Jeremy G. Siek and Walid Taha. Gradual typing for functional languages. In Scheme and Functional Programming Workshop, 2006.
[34]
Jeremy G. Siek and Philip Wadler. Threesomes, with and without blame. In POPL, 2010.
[35]
Jeremy G. Siek, Ronald Garcia, and Walid Taha. Exploring the design space of higher-order casts. In ESOP, 2009.
[36]
Jeremy G. Siek, Michael M. Vitousek, Matteo Cimini, and John Tang Boyland. Refined criteria for gradual typing. In SNAPL ’15, 2015.
[37]
Jeremy G. Siek, Michael M. Vitousek, Matteo Cimini, Sam Tobin-Hochstadt, and Ronald Garcia. Monotonic references for efficient gradual typing. In ESOP, 2015.
[38]
T. Stephen Strickland, Sam Tobin-Hochstadt, Robert Bruce Findler, and Matthew Flatt. Chaperones and impersonators: run-time support for reasonable interposition. In OOPSLA, 2012.
[39]
Nikhil Swamy, Cedric Fournet, Aseem Rastogi, Karthikeyan Bhargavan, Juan Chen, Pierre-Yves Strub, and Gavin Bierman. Gradual typing embedded securely in javascript. In POPL, 2014.
[40]
Cameron Swords, Amr Sabry, and Sam Tobin-Hochstadt. Expressing contract monitors as patterns of communication. In ICFP, 2015.
[41]
Asumu Takikawa, T. Stephen Strickland, Christos Dimoulas, Sam Tobin-Hochstadt, and Matthias Felleisen. Gradual typing for firstclass classes. In OOPSLA, 2012.
[42]
Asumu Takikawa, Daniel Feltey, Ben Greenman, Max S. New, Jan Vitek, and Matthias Felleisen. Is sound gradual typing dead? In POPL, 2016.
[43]
Satish Thatte. Quasi-static typing. In POPL, 1990.
[44]
Sam Tobin-Hochstadt and Matthias Felleisen. Interlanguage migration: From scripts to programs. In DLS, 2006.
[45]
Sam Tobin-Hochstadt and Matthias Felleisen. The design and implementation of Typed Scheme. In POPL, January 2008.
[46]
Sam Tobin-Hochstadt and Matthias Felleisen. Logical types for untyped languages. In ICFP, 2010.
[47]
Michael M. Vitousek and Jeremy G. Siek. Gradual typing in an open world. Technical Report TR729, Indiana University, 2016.
[48]
Michael M. Vitousek, Andrew M. Kent, Jeremy G. Siek, and Jim Baker. Design and evaluation of gradual typing for Python. In DLS, 2014.
[49]
Michael M. Vitousek, Cameron Swords, and Jeremy G. Siek. Big types in little runtime: Supplemental material, January 2017.
[50]
Philip Wadler and Robert Bruce Findler. Well-typed programs can’t be blamed. In ESOP, 2009.
[51]
Andrew K. Wright and Matthias Felleisen. A syntactic approach to type soundness. Information and Computation, 115(1):38–94, 1994. ISSN 0890-5401.
[52]
Tobias Wrigstad, Francesco Zappa Nardelli, Sylvain Lebresne, Johan Östlund, and Jan Vitek. In POPL, 2010.

Cited By

View all
  • (2024)Gradually Typed Languages Should Be Vigilant!Proceedings of the ACM on Programming Languages10.1145/36498428:OOPSLA1(864-892)Online publication date: 29-Apr-2024
  • (2024)Type-Based Gradual Typing Performance OptimizationProceedings of the ACM on Programming Languages10.1145/36329318:POPL(2667-2699)Online publication date: 5-Jan-2024
  • (2024)Static Blame for gradual typingJournal of Functional Programming10.1017/S095679682400002934Online publication date: 25-Mar-2024
  • Show More Cited By

Index Terms

  1. Big types in little runtime: open-world soundness and collaborative blame for gradual type systems

      Recommendations

      Comments

      Please enable JavaScript to view thecomments powered by Disqus.

      Information & Contributors

      Information

      Published In

      cover image ACM Conferences
      POPL '17: Proceedings of the 44th ACM SIGPLAN Symposium on Principles of Programming Languages
      January 2017
      901 pages
      ISBN:9781450346603
      DOI:10.1145/3009837
      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 the author(s) 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].

      Sponsors

      In-Cooperation

      Publisher

      Association for Computing Machinery

      New York, NY, United States

      Publication History

      Published: 01 January 2017

      Permissions

      Request permissions for this article.

      Check for updates

      Author Tags

      1. gradual typing
      2. interoperability
      3. semantics
      4. type systems

      Qualifiers

      • Research-article

      Funding Sources

      Conference

      POPL '17
      Sponsor:

      Acceptance Rates

      Overall Acceptance Rate 824 of 4,130 submissions, 20%

      Upcoming Conference

      POPL '25

      Contributors

      Other Metrics

      Bibliometrics & Citations

      Bibliometrics

      Article Metrics

      • Downloads (Last 12 months)250
      • Downloads (Last 6 weeks)24
      Reflects downloads up to 24 Dec 2024

      Other Metrics

      Citations

      Cited By

      View all
      • (2024)Gradually Typed Languages Should Be Vigilant!Proceedings of the ACM on Programming Languages10.1145/36498428:OOPSLA1(864-892)Online publication date: 29-Apr-2024
      • (2024)Type-Based Gradual Typing Performance OptimizationProceedings of the ACM on Programming Languages10.1145/36329318:POPL(2667-2699)Online publication date: 5-Jan-2024
      • (2024)Static Blame for gradual typingJournal of Functional Programming10.1017/S095679682400002934Online publication date: 25-Mar-2024
      • (2024)Gradual Typing Performance, Micro Configurations and Macro PerspectivesTheoretical Aspects of Software Engineering10.1007/978-3-031-64626-3_15(261-278)Online publication date: 29-Jul-2024
      • (2023)How Profilers Can Help Navigate Type MigrationProceedings of the ACM on Programming Languages10.1145/36228177:OOPSLA2(544-573)Online publication date: 16-Oct-2023
      • (2023)How to Evaluate Blame for Gradual Types, Part 2Proceedings of the ACM on Programming Languages10.1145/36078367:ICFP(159-186)Online publication date: 31-Aug-2023
      • (2023)GTP Benchmarks for Gradual Typing PerformanceProceedings of the 2023 ACM Conference on Reproducibility and Replicability10.1145/3589806.3600034(102-114)Online publication date: 27-Jun-2023
      • (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)Transitioning from structural to nominal code with efficient gradual typingProceedings of the ACM on Programming Languages10.1145/34855045:OOPSLA(1-29)Online publication date: 15-Oct-2021
      • (2021)How to evaluate blame for gradual typesProceedings of the ACM on Programming Languages10.1145/34735735:ICFP(1-29)Online publication date: 19-Aug-2021
      • Show More Cited By

      View Options

      View options

      PDF

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader

      Login options

      Media

      Figures

      Other

      Tables

      Share

      Share

      Share this Publication link

      Share on social media