skip to main content
research-article
Open Access

How to evaluate blame for gradual types

Published:19 August 2021Publication History
Skip Abstract Section

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.

Skip Supplemental Material Section

Supplemental Material

Auxiliary Presentation Video

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.

3473573.mp4

Presentation Videos

References

  1. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  2. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  3. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  4. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  5. Robert Bruce Findler and Matthias Felleisen. 2002. Contracts for Higher-Order Functions. In ICFP. 48–59. https://doi.org/10.1145/581478.581484 Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Ronald Garcia, Alison M. Clark, and Éric Tanter. 2016. Abstracting Gradual Typing. In POPL. 429–442. https://doi.org/10.1145/2837614.2837670 Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. 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 ScholarGoogle ScholarCross RefCross Ref
  8. Ben Greenman. 2020. Deep and Shallow Types. Ph.D. Dissertation. Northeastern University.Google ScholarGoogle Scholar
  9. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  10. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  11. Ben Greenman, Lukas Lazarek, Christos Dimoulas, and Matthias Felleisen. 2021. A Transient Semantics for Typed Racket. Submitted for review.Google ScholarGoogle Scholar
  12. 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 ScholarGoogle ScholarCross RefCross Ref
  13. 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 ScholarGoogle ScholarCross RefCross Ref
  14. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  15. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  16. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  17. Richard J Lipton. 1971. Fault Diagnosis of Computer Programs. Carnegie Mellon University, Pittsburgh, PA.Google ScholarGoogle Scholar
  18. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  19. John Stuart Mill. 1874. Essays on Some Unsettled Questions of Political Economy. Longmans, Green, Reader, and Dyer.Google ScholarGoogle Scholar
  20. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  21. 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 ScholarGoogle Scholar
  22. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  23. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  24. 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 ScholarGoogle ScholarCross RefCross Ref
  25. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  26. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  27. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  28. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  29. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  30. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  31. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  32. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  33. Sam Tobin-Hochstadt and Matthias Felleisen. 2010. Logical Types for Untyped Languages. In ICFP. 117–128. https://doi.org/10.1145/1863543.1863561 Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. 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 ScholarGoogle ScholarCross RefCross Ref
  35. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  36. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  37. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  38. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  39. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  40. 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 ScholarGoogle ScholarCross RefCross Ref
  41. 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 ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. How to evaluate blame for gradual types

      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 Proceedings of the ACM on Programming Languages
        Proceedings of the ACM on Programming Languages  Volume 5, Issue ICFP
        August 2021
        1011 pages
        EISSN:2475-1421
        DOI:10.1145/3482883
        Issue’s Table of Contents

        Copyright © 2021 Owner/Author

        Publisher

        Association for Computing Machinery

        New York, NY, United States

        Publication History

        • Published: 19 August 2021
        Published in pacmpl Volume 5, Issue ICFP

        Permissions

        Request permissions about this article.

        Request Permissions

        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!