{"status":"ok","message-type":"work","message-version":"1.0.0","message":{"indexed":{"date-parts":[[2026,3,18]],"date-time":"2026-03-18T04:52:05Z","timestamp":1773809525101,"version":"3.50.1"},"reference-count":29,"publisher":"Association for Computing Machinery (ACM)","issue":"ICFP","license":[{"start":{"date-parts":[[2018,7,30]],"date-time":"2018-07-30T00:00:00Z","timestamp":1532908800000},"content-version":"vor","delay-in-days":0,"URL":"https:\/\/creativecommons.org\/licenses\/by\/4.0\/"}],"funder":[{"DOI":"10.13039\/100000001","name":"National Science Foundation","doi-asserted-by":"publisher","award":["1750886"],"award-info":[{"award-number":["1750886"]}],"id":[{"id":"10.13039\/100000001","id-type":"DOI","asserted-by":"publisher"}]},{"DOI":"10.13039\/100000185","name":"Defense Advanced Research Projects Agency","doi-asserted-by":"publisher","award":["FA8750-16-C- 0044"],"award-info":[{"award-number":["FA8750-16-C- 0044"]}],"id":[{"id":"10.13039\/100000185","id-type":"DOI","asserted-by":"publisher"}]}],"content-domain":{"domain":["dl.acm.org"],"crossmark-restriction":true},"short-container-title":["Proc. ACM Program. Lang."],"published-print":{"date-parts":[[2018,7,30]]},"abstract":"<jats:p>Gradual typing allows programmers to use both static and dynamic typing in a single program. However, a well-known problem with sound gradual typing is that the interactions between static and dynamic code can cause significant performance degradation. These performance pitfalls are hard to predict and resolve, and discourage users from using gradual typing features. For example, when migrating to a more statically typed program, often adding a type annotation will trigger a slowdown that can be resolved by adding more annotations elsewhere, but since it is not clear where the additional annotations must be added, the easier solution is to simply remove the annotation. To address these problems, we develop: (1) a static cost semantics that accurately predicts the overhead of static-dynamic interactions in a gradually typed program, (2) a technique for efficiently inferring such costs for all combinations of inferrable type assignments in a program, and (3) a method for translating the results of this analysis into specific recommendations and explanations that can help programmers understand, debug, and optimize the performance of gradually typed programs. We have implemented our approach in Herder, a tool for statically analyzing the performance of different typing configurations for Reticulated Python programs. An evaluation on 15 Python programs shows that Herder can use this analysis to accurately and efficiently recommend type assignments that optimize the performance of these programs without sacrificing the safety guarantees provided by static typing.<\/jats:p>","DOI":"10.1145\/3236793","type":"journal-article","created":{"date-parts":[[2018,7,31]],"date-time":"2018-07-31T19:41:18Z","timestamp":1533066078000},"page":"1-30","update-policy":"https:\/\/doi.org\/10.1145\/crossmark-policy","source":"Crossref","is-referenced-by-count":8,"title":["Casts and costs: harmonizing safety and performance in gradual typing"],"prefix":"10.1145","volume":"2","author":[{"given":"John Peter","family":"Campora","sequence":"first","affiliation":[{"name":"University of Louisiana at Lafayette, USA"}],"role":[{"role":"author","vocabulary":"crossref"}]},{"given":"Sheng","family":"Chen","sequence":"additional","affiliation":[{"name":"University of Louisiana at Lafayette, USA"}],"role":[{"role":"author","vocabulary":"crossref"}]},{"given":"Eric","family":"Walkingshaw","sequence":"additional","affiliation":[{"name":"Oregon State University, USA"}],"role":[{"role":"author","vocabulary":"crossref"}]}],"member":"320","published-online":{"date-parts":[[2018,7,30]]},"reference":[{"key":"e_1_2_2_1_1","doi-asserted-by":"publisher","DOI":"10.1145\/2714064.2660222"},{"key":"e_1_2_2_2_1","doi-asserted-by":"publisher","DOI":"10.1145\/3133878"},{"key":"e_1_2_2_3_1","doi-asserted-by":"publisher","DOI":"10.1145\/3158103"},{"key":"e_1_2_2_4_1","doi-asserted-by":"publisher","DOI":"10.1145\/3093333.3009858"},{"key":"e_1_2_2_5_1","doi-asserted-by":"publisher","DOI":"10.1145\/3022670.2951950"},{"key":"e_1_2_2_6_1","doi-asserted-by":"publisher","DOI":"10.1145\/2364527.2364535"},{"key":"e_1_2_2_7_1","doi-asserted-by":"publisher","DOI":"10.1145\/2518190"},{"key":"e_1_2_2_8_1","volume-title":"European Conf. on Object-Oriented Programming (ECOOP) (LIPIcs)","volume":"56","author":"Chen Sheng","year":"2016","unstructured":"Sheng Chen , Martin Erwig , and Eric Walkingshaw . 2016 . A Calculus for Variational Programming . In European Conf. on Object-Oriented Programming (ECOOP) (LIPIcs) , Vol. 56 . 6:1\u20136:26. Sheng Chen, Martin Erwig, and Eric Walkingshaw. 2016. A Calculus for Variational Programming. In European Conf. on Object-Oriented Programming (ECOOP) (LIPIcs) , Vol. 56. 6:1\u20136:26."},{"key":"e_1_2_2_9_1","doi-asserted-by":"publisher","DOI":"10.1145\/2784731.2784749"},{"key":"e_1_2_2_10_1","doi-asserted-by":"publisher","DOI":"10.1145\/2428116.2428123"},{"key":"e_1_2_2_11_1","doi-asserted-by":"publisher","DOI":"10.1145\/2063239.2063245"},{"key":"e_1_2_2_12_1","first-page":"55","article-title":"Variation Programming with the Choice Calculus. In Generative and Transformational Techniques in Software Engineering IV (GTTSE 2011)","volume":"7680","author":"Erwig Martin","year":"2013","unstructured":"Martin Erwig and Eric Walkingshaw . 2013 . Variation Programming with the Choice Calculus. In Generative and Transformational Techniques in Software Engineering IV (GTTSE 2011) , Revised and Extended Papers (LNCS) , Vol. 7680. 55 \u2013 99 . Martin Erwig and Eric Walkingshaw. 2013. Variation Programming with the Choice Calculus. In Generative and Transformational Techniques in Software Engineering IV (GTTSE 2011), Revised and Extended Papers (LNCS) , Vol. 7680. 55\u201399.","journal-title":"Revised and Extended Papers (LNCS)"},{"key":"e_1_2_2_13_1","doi-asserted-by":"publisher","DOI":"10.1145\/2676726.2676992"},{"key":"e_1_2_2_14_1","doi-asserted-by":"publisher","DOI":"10.1145\/2837614.2837670"},{"key":"e_1_2_2_15_1","doi-asserted-by":"publisher","DOI":"10.1145\/3009837.3009842"},{"key":"e_1_2_2_16_1","doi-asserted-by":"publisher","DOI":"10.1007\/978-3-642-11957-6_16"},{"key":"e_1_2_2_17_1","doi-asserted-by":"publisher","DOI":"10.1007\/978-3-662-46669-8_6"},{"key":"e_1_2_2_18_1","doi-asserted-by":"publisher","DOI":"10.1145\/3133880"},{"key":"e_1_2_2_19_1","doi-asserted-by":"publisher","DOI":"10.1145\/2103621.2103714"},{"key":"e_1_2_2_20_1","doi-asserted-by":"publisher","DOI":"10.1145\/3133879"},{"key":"e_1_2_2_21_1","doi-asserted-by":"publisher","DOI":"10.1007\/978-3-642-00590-9_2"},{"key":"e_1_2_2_22_1","volume-title":"Siek and Walid Taha","author":"Jeremy","year":"2006","unstructured":"Jeremy G. Siek and Walid Taha . 2006 . Gradual Typing for Functional Languages. In IN SCHEME AND FUNCTIONAL PROGRAMMING WORKSHOP . 81\u201392. Jeremy G. Siek and Walid Taha. 2006. Gradual Typing for Functional Languages. In IN SCHEME AND FUNCTIONAL PROGRAMMING WORKSHOP . 81\u201392."},{"key":"e_1_2_2_23_1","doi-asserted-by":"publisher","DOI":"10.1145\/1408681.1408688"},{"key":"e_1_2_2_24_1","doi-asserted-by":"publisher","DOI":"10.1145\/2837614.2837630"},{"key":"e_1_2_2_25_1","doi-asserted-by":"publisher","DOI":"10.1145\/1176617.1176755"},{"key":"e_1_2_2_26_1","volume-title":"Migratory Typing: Ten Years Later. In 2nd Summit on Advances in Programming Languages (SNAPL 2017) (Leibniz International Proceedings in Informatics (LIPIcs)) , Benjamin S","author":"Tobin-Hochstadt Sam","year":"2017","unstructured":"Sam Tobin-Hochstadt , Matthias Felleisen , Robert Findler , Matthew Flatt , Ben Greenman , Andrew M. Kent , Vincent St-Amour , T. Stephen Strickland , and Asumu Takikawa . 2017 . Migratory Typing: Ten Years Later. In 2nd Summit on Advances in Programming Languages (SNAPL 2017) (Leibniz International Proceedings in Informatics (LIPIcs)) , Benjamin S . Lerner, Rastislav Bod\u00edk, and Shriram Krishnamurthi (Eds.), Vol. 71 . Schloss Dagstuhl\u2013Leibniz-Zentrum fuer Informatik, Dagstuhl, Germany , 17:1\u201317:17. Sam Tobin-Hochstadt, Matthias Felleisen, Robert Findler, Matthew Flatt, Ben Greenman, Andrew M. Kent, Vincent St-Amour, T. Stephen Strickland, and Asumu Takikawa. 2017. Migratory Typing: Ten Years Later. In 2nd Summit on Advances in Programming Languages (SNAPL 2017) (Leibniz International Proceedings in Informatics (LIPIcs)) , Benjamin S. Lerner, Rastislav Bod\u00edk, and Shriram Krishnamurthi (Eds.), Vol. 71. Schloss Dagstuhl\u2013Leibniz-Zentrum fuer Informatik, Dagstuhl, Germany, 17:1\u201317:17."},{"key":"e_1_2_2_27_1","unstructured":"Guido van Rossum Jukka Lehtosalo and \u0141ukasz Langa. 2014. PEP 484 \u2013 Type Hints. https:\/\/www.python.org\/dev\/peps\/ pep-0484\/#rationale-and-goals  Guido van Rossum Jukka Lehtosalo and \u0141ukasz Langa. 2014. PEP 484 \u2013 Type Hints. https:\/\/www.python.org\/dev\/peps\/ pep-0484\/#rationale-and-goals"},{"key":"e_1_2_2_28_1","doi-asserted-by":"publisher","DOI":"10.1145\/2661088.2661101"},{"key":"e_1_2_2_29_1","doi-asserted-by":"publisher","DOI":"10.1145\/3009837.3009849"}],"container-title":["Proceedings of the ACM on Programming Languages"],"original-title":[],"language":"en","link":[{"URL":"https:\/\/dl.acm.org\/doi\/10.1145\/3236793","content-type":"unspecified","content-version":"vor","intended-application":"text-mining"},{"URL":"https:\/\/dl.acm.org\/doi\/pdf\/10.1145\/3236793","content-type":"application\/pdf","content-version":"vor","intended-application":"syndication"},{"URL":"https:\/\/dl.acm.org\/doi\/pdf\/10.1145\/3236793","content-type":"unspecified","content-version":"vor","intended-application":"similarity-checking"}],"deposited":{"date-parts":[[2025,6,18]],"date-time":"2025-06-18T21:41:28Z","timestamp":1750282888000},"score":1,"resource":{"primary":{"URL":"https:\/\/dl.acm.org\/doi\/10.1145\/3236793"}},"subtitle":[],"short-title":[],"issued":{"date-parts":[[2018,7,30]]},"references-count":29,"journal-issue":{"issue":"ICFP","published-print":{"date-parts":[[2018,7,30]]}},"alternative-id":["10.1145\/3236793"],"URL":"https:\/\/doi.org\/10.1145\/3236793","relation":{},"ISSN":["2475-1421"],"issn-type":[{"value":"2475-1421","type":"electronic"}],"subject":[],"published":{"date-parts":[[2018,7,30]]},"assertion":[{"value":"2018-07-30","order":2,"name":"published","label":"Published","group":{"name":"publication_history","label":"Publication History"}}]}}