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.
- M. Abadi, L. Cardelli, B. Pierce, and G. Plotkin. Dynamic typing in a statically-typed language. In POPL, 1989. Google Scholar
Digital Library
- Amal Ahmed, Robert Bruce Findler, Jeremy G. Siek, and Philip Wadler. Blame for all. In POPL, 2011.Google Scholar
Digital Library
- Esteban Allende, Oscar Calla´u, Johan Fabry, Éric Tanter, and Markus Denker. Gradual typing for smalltalk. Science of Computer Programming, August 2013. Google Scholar
Digital Library
- Esteban Allende, Johan Fabry, and Éric Tanter. Cast insertion strategies for gradually-typed objects. In DLS, 2013. Google Scholar
Digital Library
- Christopher Anderson and Sophia Drossopoulou. BabyJ - from object based to class based programming via types. In Workshop on Object Oriented Developments, 2003.Google Scholar
- Andrew W. Appel. Compiling with Continuations. Cambridge University Press, New York, NY, USA, 2007. Google Scholar
Digital Library
- Gavin Bierman, Erik Meijer, and Mads Torgersen. In ECOOP. Springer-Verlag.Google Scholar
- 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. Google Scholar
Digital Library
- Ambrose Bonnaire-Sergeant, Rowan Davies, and Sam Tobin-Hochstad. Practical optional types for clojure. In ESOP, 2016.Google Scholar
Cross Ref
- Gilad Bracha and David Griswold. Strongtalk: Typechecking smalltalk in a production environment. In OOPSLA, New York, NY, USA, 1993. ACM. Google Scholar
Digital Library
- Robert Cartwright. User-defined data types as an aid to verifying LISP programs. In ICALP, 1976.Google Scholar
- 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.Google Scholar
- Christos Dimoulas, Robert Bruce Findler, Cormac Flanagan, and Matthias Felleisen. Correct blame for contracts: no more scapegoating. In POPL, 2011. Google Scholar
Digital Library
- Christos Dimoulas, Sam Tobin-Hochstadt, and Matthias Felleisen. Complete monitors for behavioral contracts. In ESOP, 2012. Google Scholar
Digital Library
- Eiffel. The Power of Design by Contract.Google Scholar
- Facebook. Hack, 2013.Google Scholar
- Robert Bruce Findler and Matthias Blume. Contracts as pairs of projections. In FLOPS, 2006.Google Scholar
Digital Library
- Robert Bruce Findler and Matthias Felleisen. Contracts for higherorder functions. In ICFP, 2002.Google Scholar
Digital Library
- Cormac Flanagan. Hybrid type checking. In POPL, Charleston, South Carolina, 2006. Google Scholar
Digital Library
- Google. Dart: structured web apps, 2011.Google Scholar
- Kathryn E. Gray, Robert Bruce Findler, and Matthew Flatt. Finegrained interoperability through mirrors and contracts. In OOPSLA. ACM Press, 2005. Google Scholar
Digital Library
- Robert Harper. Practical Foundations for Programming Languages. Cambridge University Press, New York, NY, USA, 2012. Google Scholar
Digital Library
- David Herman, Aaron Tomb, and Cormac Flanagan. Space-efficient gradual typing. In Trends in Functional Programming, 2007.Google Scholar
- Matthias Keil and Peter Thiemann. Blame assignment for higher-order contracts with intersection and union. In ICFP, 2015. Google Scholar
Digital Library
- Matthias Keil and Peter Thiemann. Transparent object proxies in JavaScript. In ECOOP, 2015.Google Scholar
- Gianluca Mezzetti, Anders Møller, and Fabio Strocco. Type unsoundness in practice: An empirical study of Dart. In DLS, 2016. Google Scholar
Digital Library
- Microsoft. Typescript, 2012.Google Scholar
- Aseem Rastogi, Avik Chaudhuri, and Basil Hosmer. The ins and outs of gradual type inference. In POPL, 2012. Google Scholar
Digital Library
- 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.Google Scholar
- Brianna M. Ren, John Toman, T. Stephen Strickland, and Jeffrey S. Foster. The ruby type checker. In Symposium on Applied Computing, 2013. Google Scholar
Digital Library
- Gregor Richards, Francesco Zappa Nardelli, and Jan Vitek. Concrete Types for TypeScript. In ECOOP, 2015.Google Scholar
- Manuel Serrano. Bigloo: a practical Scheme compiler. Inria-Rocquencourt, April 2002.Google Scholar
- Jeremy G. Siek and Walid Taha. Gradual typing for functional languages. In Scheme and Functional Programming Workshop, 2006.Google Scholar
- Jeremy G. Siek and Philip Wadler. Threesomes, with and without blame. In POPL, 2010. Google Scholar
Digital Library
- Jeremy G. Siek, Ronald Garcia, and Walid Taha. Exploring the design space of higher-order casts. In ESOP, 2009. Google Scholar
Digital Library
- Jeremy G. Siek, Michael M. Vitousek, Matteo Cimini, and John Tang Boyland. Refined criteria for gradual typing. In SNAPL ’15, 2015.Google Scholar
- Jeremy G. Siek, Michael M. Vitousek, Matteo Cimini, Sam Tobin-Hochstadt, and Ronald Garcia. Monotonic references for efficient gradual typing. In ESOP, 2015. Google Scholar
Digital Library
- T. Stephen Strickland, Sam Tobin-Hochstadt, Robert Bruce Findler, and Matthew Flatt. Chaperones and impersonators: run-time support for reasonable interposition. In OOPSLA, 2012. Google Scholar
Digital Library
- 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. Google Scholar
Digital Library
- Cameron Swords, Amr Sabry, and Sam Tobin-Hochstadt. Expressing contract monitors as patterns of communication. In ICFP, 2015. Google Scholar
Digital Library
- Asumu Takikawa, T. Stephen Strickland, Christos Dimoulas, Sam Tobin-Hochstadt, and Matthias Felleisen. Gradual typing for firstclass classes. In OOPSLA, 2012. Google Scholar
Digital Library
- Asumu Takikawa, Daniel Feltey, Ben Greenman, Max S. New, Jan Vitek, and Matthias Felleisen. Is sound gradual typing dead? In POPL, 2016. Google Scholar
Digital Library
- Satish Thatte. Quasi-static typing. In POPL, 1990. Google Scholar
Digital Library
- Sam Tobin-Hochstadt and Matthias Felleisen. Interlanguage migration: From scripts to programs. In DLS, 2006.Google Scholar
- Sam Tobin-Hochstadt and Matthias Felleisen. The design and implementation of Typed Scheme. In POPL, January 2008. Google Scholar
Digital Library
- Sam Tobin-Hochstadt and Matthias Felleisen. Logical types for untyped languages. In ICFP, 2010. Google Scholar
Digital Library
- Michael M. Vitousek and Jeremy G. Siek. Gradual typing in an open world. Technical Report TR729, Indiana University, 2016.Google Scholar
- Michael M. Vitousek, Andrew M. Kent, Jeremy G. Siek, and Jim Baker. Design and evaluation of gradual typing for Python. In DLS, 2014. Google Scholar
Digital Library
- Michael M. Vitousek, Cameron Swords, and Jeremy G. Siek. Big types in little runtime: Supplemental material, January 2017.Google Scholar
- Philip Wadler and Robert Bruce Findler. Well-typed programs can’t be blamed. In ESOP, 2009. Google Scholar
Digital Library
- Andrew K. Wright and Matthias Felleisen. A syntactic approach to type soundness. Information and Computation, 115(1):38–94, 1994. ISSN 0890-5401. Google Scholar
Digital Library
- Tobias Wrigstad, Francesco Zappa Nardelli, Sylvain Lebresne, Johan Östlund, and Jan Vitek. In POPL, 2010.Google Scholar
Index Terms
Big types in little runtime: open-world soundness and collaborative blame for gradual type systems
Recommendations
Big types in little runtime: open-world soundness and collaborative blame for gradual type systems
POPL '17: Proceedings of the 44th ACM SIGPLAN Symposium on Principles of Programming LanguagesGradual 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 ...
The gradualizer: a methodology and algorithm for generating gradual type systems
POPL '16: Proceedings of the 43rd Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming LanguagesMany languages are beginning to integrate dynamic and static typing. Siek and Taha offered gradual typing as an approach to this integration that provides a coherent and full-span migration between the two disciplines. However, the literature lacks a ...
The gradualizer: a methodology and algorithm for generating gradual type systems
POPL '16Many languages are beginning to integrate dynamic and static typing. Siek and Taha offered gradual typing as an approach to this integration that provides a coherent and full-span migration between the two disciplines. However, the literature lacks a ...







Comments