Abstract
Gradual typing combines static and dynamic typing flexibly and safely in a single programming language. To do so, gradually typed languages implicitly insert casts where needed, to ensure at runtime that typing assumptions are not violated by untyped code. However, the implicit nature of cast insertion, especially on higher-order values, can jeopardize reliability and efficiency: higher-order casts can fail at any time, and are costly to execute. We propose Confined Gradual Typing, which extends gradual typing with two new type qualifiers that let programmers control the flow of values between the typed and the untyped worlds, and thereby trade some flexibility for more reliability and performance. We formally develop two variants of Confined Gradual Typing that capture different flexibility/guarantee tradeoffs. We report on the implementation of Confined Gradual Typing in Gradualtalk, a gradually-typed Smalltalk, which confirms the performance advantage of avoiding unwanted higher-order casts and the low overhead of the approach.
- E. Allende, O. Callaú, J. Fabry, É. Tanter, and M. Denker. Gradual typing for Smalltalk. Science of Computer Programming, Aug. 2013. Available online.Google Scholar
- E. Allende, J. Fabry, and É. Tanter. Cast insertion strategies for gradually-typed objects. In Proceedings of the 9th ACM Dynamic Languages Symposium (DLS 2013), pages 27--36, Indianapolis, IN, USA, Oct. 2013. ACM Press. ACM SIGPLAN Notices, 49(2). Google Scholar
Digital Library
- E. Allende, J. Fabry, R. Garcia, and É. Tanter. Confined gradual typing -- extended version with detailed proofs. Technical Report TR/DCC-2014--3, University of Chile, May 2014.Google Scholar
- B. Bloom, J. Field, N. Nystrom, J. Östlund, G. Richards, R. Strnisa, J. Vitek, and T. Wrigstad. Thorn: robust, concurrent, extensible scripting on the JVM. In Proceedings of the 24th ACM SIGPLAN Conference on Object-Oriented Programming Systems, Languages and Applications (OOPSLA 2009), pages 117--136, Orlando, Florida, USA, Oct. 2009. ACM Press. Google Scholar
Digital Library
- G. Bracha. Pluggable type systems. In OOPSLA Workshop on Revival of Dynamic Languages, pages 1--6, 2004.Google Scholar
- G. Bracha and D. Griswold. Strongtalk: Typechecking Smalltalk in a production environment. In Proceedings of the 8th International Conference on Object-Oriented Programming Systems, Languages and Applications (OOPSLA 95), pages 215--230, Washington, D.C., USA, Oct. 1993. ACM Press. ACM SIGPLAN Notices, 28(10). Google Scholar
Digital Library
- R. Cartwright and M. Fagan. Soft typing. In Proceedings of the ACM SIGPLAN International Conference on Programming Language Design and Implementation (PLDI), pages 278--292, Toronto, Ontario, Canada, 1991. Google Scholar
Digital Library
- G. Castagna, editor. Proceedings of the 18th European Symposium on Programming Languages and Systems (ESOP 2009), volume 5502 of phLecture Notes in Computer Science, York, UK, 2009. Springer-Verlag. Google Scholar
Digital Library
- R. B. Findler and M. Felleisen. Contracts for higher-order functions. In Proceedings of the 7th ACM SIGPLAN International Conference on Functional Programming, pages 48--59, Pittsburgh, PA, USA, 2002. ACM Press. Google Scholar
Digital Library
- M. Furr. Combining Static and Dynamic Typing in Ruby. PhD thesis, University of Maryland, 2009.Google Scholar
- D. Grossman, G. Morrisett, and S. Zdancewic. Syntactic type abstraction. ACM Transactions on Programming Languages and Systems, 22 (6): 1037--1080, Nov. 2000. Google Scholar
Digital Library
- D. Herman, A. Tomb, and C. Flanagan. Space-efficient gradual typing. Higher-Order and Sympolic Computation, 23 (2): 167--189, June 2010. Google Scholar
Digital Library
- L. Ina and A. Igarashi. Gradual typing for generics. In Proceedings of the 26th ACM SIGPLAN Conference on Object-Oriented Programming Systems, Languages and Applications (OOPSLA 2011), pages 609--624, Portland, Oregon, USA, Oct. 2011. ACM Press. Google Scholar
Digital Library
- K. Knowles and C. Flanagan. Hybrid type checking. ACM Transactions on Programming Languages and Systems, 32 (2): Article n.6, Jan. 2010. Google Scholar
Digital Library
- J. Matthews and R. B. Findler. Operational semantics for multi-language programs. In Proceedings of the 34th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL 2007), pages 3--10, Nice, France, Jan. 2007. ACM Press. Google Scholar
Digital Library
- POPL 2010. Proceedings of the 37th annual ACM SIGPLAN-SIGACT symposium on Principles of programming languages (POPL 2010), Madrid, Spain, Jan. 2010. ACM Press.Google Scholar
- A. Rastogi, A. Chaudhuri, and B. Hosmer. The ins and outs of gradual type inference. In Proceedings of the 39th annual ACM SIGPLAN-SIGACT symposium on Principles of programming languages (POPL 2012), pages 481--494, Philadelphia, USA, Jan. 2012. ACM Press. Google Scholar
Digital Library
- B. V. Ryseghem, S. Ducasse, and J. Fabry. Seamless composition and reuse of customizable user interfaces with Spec. Science of Computer Programming, 2014. To appear.Google Scholar
Digital Library
- J. Siek and W. Taha. Gradual typing for functional languages. In Proceedings of the Scheme and Functional Programming Workshop, pages 81--92, Sept. 2006.Google Scholar
- J. Siek and W. Taha. Gradual typing for objects. In E. Ernst, editor, Proceedings of the 21st European Conference on Object-oriented Programming (ECOOP 2007), number 4609 in Lecture Notes in Computer Science, pages 2--27, Berlin, Germany, July 2007. Springer-Verlag. Google Scholar
Digital Library
- J. Siek and P. Wadler. Threesomes, with and without blame. Incitetpopl2010, pages 365--376. Google Scholar
Digital Library
- J. Siek, R. Garcia, and W. Taha. Exploring the design space of higher-order casts. Incitetesop2009, pages 17--31. Google Scholar
Digital Library
- N. Swamy, C. Fournet, A. Rastogi, K. Bhargavan, J. Chen, P.-Y. Strub, and G. Bierman. Gradual typing embedded securely in JavaScript. In Proceedings of the 41st ACM SIGPLAN-SIGACT symposium on Principles of programming languages (POPL 2014), pages 425--437, San Diego, CA, USA, Jan. 2014. ACM Press. Google Scholar
Digital Library
- A. Takikawa, T. S. Strickland, C. Dimoulas, S. Tobin-Hochstadt, and M. Felleisen. Gradual typing for first-class classes. In Proceedings of the 27th ACM SIGPLAN Conference on Object-Oriented Programming Systems, Languages and Applications (OOPSLA 2012), pages 793--810, Tucson, AZ, USA, Oct. 2012. ACM Press. Google Scholar
Digital Library
- S. Tobin-Hochstadt. Typed Scheme: From Scripts to Programs. PhD thesis, Northeastern University, Jan. 2010.Google Scholar
- S. Tobin-Hochstadt and M. Felleisen. Interlanguage migration: from scripts to programs. In Proceedings of the ACM Dynamic Languages Symposium (DLS 2006), pages 964--974, Portland, Oregon, USA, Oct. 2006. ACM Press. Google Scholar
Digital Library
- P. Wadler and R. B. Findler. Well-typed programs can't be blamed. Incitetesop2009, pages 1--16. Google Scholar
Digital Library
- T. Wrigstad, F. Zappa Nardelli, S. Lebresne, J. Östlund, and J. Vitek. Integrating typed and untyped code in a scripting language. Incitetpopl2010, pages 377--388. Google Scholar
Digital Library
Index Terms
Confined gradual typing
Recommendations
Confined gradual typing
OOPSLA '14: Proceedings of the 2014 ACM International Conference on Object Oriented Programming Systems Languages & ApplicationsGradual typing combines static and dynamic typing flexibly and safely in a single programming language. To do so, gradually typed languages implicitly insert casts where needed, to ensure at runtime that typing assumptions are not violated by untyped ...
On polymorphic gradual typing
We study an extension of gradual typing—a method to integrate dynamic typing and static typing smoothly in a single language—to parametric polymorphism and its theoretical properties, including conservativity of typing and semantics over both statically ...
Challenges and progress toward efficient gradual typing (invited talk)
DLS '17Mixing static and dynamic type checking in the same language is catching on, with the TypeScript and Flow variants of JavaScript, the MyPy and Reticulated variants of Python, the Strongtalk and Gradualtalk variants of Smalltalk, as well as Typed Racket,...







Comments