Abstract
Programming language theoreticians develop blame assignment systems and prove blame theorems for gradually typed programming languages. Practical implementations of gradual typing almost completely ignore the idea of blame assignment. This contrast raises the question whether blame provides any value to the working programmer and poses the challenge of how to evaluate the effectiveness of blame assignment strategies. This paper contributes (1) the first evaluation method for blame assignment strategies and (2) the results from applying it to three different semantics for gradual typing. These results cast doubt on the theoretical effectiveness of blame in gradual typing. In most scenarios, strategies with imprecise blame assignment are as helpful to a rationally acting programmer as strategies with provably correct blame.
Supplemental Material
- John Peter Campora and Sheng Chen. 2020. Taming Type Annotations in Gradual Typing. PACMPL, 4, OOPSLA, 191:1–191:30. https://doi.org/10.1145/3428259 Google Scholar
Digital Library
- Giuseppe Castagna and Victor Lanvin. 2017. Gradual Typing with Union and Intersection Types. PACMPL, 1, ICFP (2017), 41:1–41:28. https://doi.org/10.1145/3110285 Google Scholar
Digital Library
- Richard A. DeMillo, Richard J. Lipton, and Frederick G. Sayward. 1978. Hints on Test Data Selection: Help for the Practicing Programmer. Computer, 11, 4 (1978), 34–41. https://doi.org/10.1109/C-M.1978.218136 Google Scholar
Digital Library
- Asger Feldthaus and Anders Møller. 2014. Checking Correctness of TypeScript Interfaces for JavaScript Libraries. In OOPSLA. 1–16. https://doi.org/10.1145/2660193.2660215 Google Scholar
Digital Library
- Robert Bruce Findler and Matthias Felleisen. 2002. Contracts for Higher-Order Functions. In ICFP. 48–59. https://doi.org/10.1145/581478.581484 Google Scholar
Digital Library
- Ronald Garcia, Alison M. Clark, and Éric Tanter. 2016. Abstracting Gradual Typing. In POPL. 429–442. https://doi.org/10.1145/2837614.2837670 Google Scholar
Digital Library
- Rahul Gopinath and Eric Walkingshaw. 2017. How Good Are Your Types? Using Mutation Analysis to Evaluate the Effectiveness of Type Annotations. In ICSTW. 122–127. https://doi.org/10.1109/ICSTW.2017.28 Google Scholar
Cross Ref
- Ben Greenman. 2020. Deep and Shallow Types. Ph.D. Dissertation. Northeastern University.Google Scholar
- Ben Greenman and Matthias Felleisen. 2018. A Spectrum of Type Soundness and Performance. PACMPL, 2, ICFP (2018), 71:1–71:32. https://doi.org/10.1145/3235045 Google Scholar
Digital Library
- Ben Greenman, Matthias Felleisen, and Christos Dimoulas. 2019. Complete Monitors for Gradual Types. PACMPL, 3, OOPSLA (2019), 122:1–122:29. https://doi.org/10.1145/3360548 Google Scholar
Digital Library
- Ben Greenman, Lukas Lazarek, Christos Dimoulas, and Matthias Felleisen. 2021. A Transient Semantics for Typed Racket. Submitted for review.Google Scholar
- Ben Greenman, Asumu Takikawa, Max S. New, Daniel Feltey, Robert Bruce Findler, Jan Vitek, and Matthias Felleisen. 2019. How to Evaluate the Performance of Gradual Type Systems. Journal of Functional Programming, 29, e4 (2019), 1–45. https://doi.org/10.1017/S0956796818000217 Google Scholar
Cross Ref
- Joseph Henrich, Robert Boyd, Samuel Bowles, Colin Camerer, Ernst Fehr, Herbert Gintis, and Richard McElreath. 2001. In Search of Homo Economicus: Behavioral Experiments in 15 Small-Scale Societies. American Economic Review, 91, 2 (2001), 73–78. https://pubs.aeaweb.org/doi/pdf/10.1257/aer.91.2.73 Google Scholar
Cross Ref
- Yue Jia and Mark Harman. 2011. An Analysis and Survey of the Development of Mutation Testing. IEEE Transactions on Software Engineering, 37, 5 (2011), 649–678. https://doi.org/10.1109/TSE.2010.62 Google Scholar
Digital Library
- Andre Kuhlenschmidt, Deyaaeldeen Almahallawi, and Jeremy G. Siek. 2019. Toward Efficient Gradual Typing for Structural Types via Coercions. In PLDI. 517–532. https://doi.org/10.1145/3325989 Google Scholar
Digital Library
- Lukas Lazarek, Alexis King, Samanvitha Sundar, Robert B. Findler, and Christos Dimoulas. 2020. Does Blame Shifting Work? PACMPL, 4, POPL (2020), 65:1–65:29. https://doi.org/10.1145/3373113 Google Scholar
Digital Library
- Richard J Lipton. 1971. Fault Diagnosis of Computer Programs. Carnegie Mellon University, Pittsburgh, PA.Google Scholar
- Jacob Matthews and Robert Bruce Findler. 2009. Operational Semantics for Multi-Language Programs. TOPLAS, 31, 3 (2009), 1–44. https://doi.org/10.1145/1498926.1498930 Google Scholar
Digital Library
- John Stuart Mill. 1874. Essays on Some Unsettled Questions of Political Economy. Longmans, Green, Reader, and Dyer.Google Scholar
- Fabian Muehlboeck and Ross Tate. 2017. Sound Gradual Typing is Nominally Alive and Well. PACMPL, 1, OOPSLA (2017), 56:1–56:30. https://doi.org/10.1145/3133880 Google Scholar
Digital Library
- Hari Prashanth and Sam Tobin-Hochstadt. 2010. Functional Data Structures for Typed Racket. In SFP. 8–14. http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.308.8444Google Scholar
- Aseem Rastogi, Nikhil Swamy, Cédric Fournet, Gavin Bierman, and Panagiotis Vekris. 2015. Safe & Efficient Gradual Typing for TypeScript. In POPL. 167–180. https://doi.org/10.1145/2676726.2676971 Google Scholar
Digital Library
- Gregor Richards, Ellen Arteca, and Alexi Turcotte. 2017. The VM Already Knew That: Leveraging Compile-Time Knowledge to Optimize Gradual Typing. PACMPL, 1, OOPSLA (2017), 55:1–55:27. https://doi.org/10.1145/3133879 Google Scholar
Digital Library
- Gregor Richards, Francesco Zappa Nardelli, and Jan Vitek. 2015. Concrete Types for TypeScript. In ECOOP. 76–100. https://doi.org/10.4230/LIPIcs.ECOOP.2015.76 Google Scholar
Cross Ref
- Jeremy Siek, Michael M. Vitousek, Matteo Cimini, Sam Tobin-Hochstadt, and Ronald Garcia. 2015. Monotonic References for Efficient Gradual Typing. In ESOP. 432–456. https://doi.org/10.1007/978-3-662-46669-8_18 Google Scholar
Digital Library
- Vincent St-Amour, Sam Tobin-Hochstadt, Matthew Flatt, and Matthias Felleisen. 2012. Typing the Numeric Tower. In PADL. 289–303. https://doi.org/10.1007/978-3-642-27694-1_21 Google Scholar
Digital Library
- Vincent St-Amour and Neil Toronto. 2013. Experience Report: Applying Random Testing to a Base Type Environment. In ICFP. 351–356. https://doi.org/10.1145/2500365.2500616 Google Scholar
Digital Library
- Nikhil Swamy, Cédric Fournet, Aseem Rastogi, Karthikeyan Bhargavan, Juan Chen, Pierre-Yves Strub, and Gavin Bierman. 2014. Gradual Typing Embedded Securely in JavaScript. In POPL. 425–437. https://doi.org/10.1145/2535838.2535889 Google Scholar
Digital Library
- Asumu Takikawa, Daniel Feltey, Ben Greenman, Max S. New, Jan Vitek, and Matthias Felleisen. 2016. Is Sound Gradual Typing Dead? In POPL. 456–468. https://doi.org/10.1145/2837614.2837630 Google Scholar
Digital Library
- Asumu Takikawa, T. Stephen Strickland, Christos Dimoulas, Sam Tobin-Hochstadt, and Matthias Felleisen. 2012. Gradual Typing for First-Class Classes. In OOPSLA. 793–810. https://doi.org/10.1145/2384616.2384674 Google Scholar
Digital Library
- Sam Tobin-Hochstadt and Matthias Felleisen. 2006. Interlanguage Migration: from Scripts to Programs. In DLS. 964–974. https://doi.org/10.1145/1176617.1176755 Google Scholar
Digital Library
- Sam Tobin-Hochstadt and Matthias Felleisen. 2008. The Design and Implementation of Typed Scheme. In POPL. 395–406. https://doi.org/10.1145/1328438.1328486 Google Scholar
Digital Library
- Sam Tobin-Hochstadt and Matthias Felleisen. 2010. Logical Types for Untyped Languages. In ICFP. 117–128. https://doi.org/10.1145/1863543.1863561 Google Scholar
Digital Library
- Sam Tobin-Hochstadt, Matthias Felleisen, Robert Bruce Findler, Matthew Flatt, Ben Greenman, Andrew M. Kent, Vincent St-Amour, T. Stephen Strickland, and Asumu Takikawa. 2017. Migratory Typing: Ten Years Later. In SNAPL. 17:1–17:17. https://doi.org/10.4230/LIPIcs.SNAPL.2017.17 Google Scholar
Cross Ref
- Preston Tunnell Wilson, Ben Greenman, Justin Pombrio, and Shriram Krishnamurthi. 2018. The Behavior of Gradual Types: a User Study. In DLS. 1–12. https://doi.org/10.1145/3276945.3276947 Google Scholar
Digital Library
- Michael M. Vitousek, Andrew Kent, Jeremy G. Siek, and Jim Baker. 2014. Design and Evaluation of Gradual Typing for Python. In DLS. 45–56. https://doi.org/10.1145/2661088.2661101 Google Scholar
Digital Library
- Michael M. Vitousek, Jeremy G. Siek, and Avik Chaudhuri. 2019. Optimizing and Evaluating Transient Gradual Typing. In DLS. 28–41. https://doi.org/10.1145/3359619.3359742 Google Scholar
Digital Library
- Michael M. Vitousek, Cameron Swords, and Jeremy G. Siek. 2017. Big Types in Little Runtime: Open-World Soundness and Collaborative Blame for Gradual Type Systems. In POPL. 762–774. https://doi.org/10.1145/3009837.3009849 Google Scholar
Digital Library
- Philip Wadler and Robert Bruce Findler. 2009. Well-typed Programs Can’t Be Blamed. In ESOP. 1–15. https://doi.org/10.1007/978-3-642-00590-9_1 Google Scholar
Digital Library
- Jack Williams, J. Garrett Morris, Philip Wadler, and Jakub Zalewski. 2017. Mixed Messages: Measuring Conformance and Non-Interference in TypeScript. In ECOOP. 28:1–28:29. https://doi.org/10.4230/LIPIcs.ECOOP.2017.28 Google Scholar
Cross Ref
- Tobias Wrigstad, Francesco Zappa Nardelli, Sylvain Lebresne, Johan Ostlund, and Jan Vitek. 2010. Integrating Typed and Untyped Code in a Scripting Language. In POPL. 377–388. https://doi.org/10.1145/1706299.1706343 Google Scholar
Digital Library
Index Terms
How to evaluate blame for gradual types
Recommendations
Gradual typing with union and intersection types
We propose a type system for functional languages with gradual types and set-theoretic type connectives and prove its soundness. In particular, we show how to lift the definition of the domain and result type of an application from non-gradual types to ...
Principal Type Schemes for Gradual Programs
POPL '15: Proceedings of the 42nd Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming LanguagesGradual typing is a discipline for integrating dynamic checking into a static type system. Since its introduction in functional languages, it has been adapted to a variety of type systems, including object-oriented, security, and substructural. This ...
The root cause of blame: contracts for intersection and union types
Gradual typing has emerged as the tonic for programmers with a thirst for a blend of static and dynamic typing. Contracts provide a lightweight form of gradual typing as they can be implemented as a library, rather than requiring a gradual type system.
...






Comments