Affiliation:
1. University of Chile, Santiago, Chile
2. University of British Columbia, Vancouver, BC, Canada
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.
Funder
Fondo Nacional de Desarrollo Científico y Tecnológico
Publisher
Association for Computing Machinery (ACM)
Subject
Computer Graphics and Computer-Aided Design,Software
Cited by
4 articles.
订阅此论文施引文献
订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献
1. GTP Benchmarks for Gradual Typing Performance;Proceedings of the 2023 ACM Conference on Reproducibility and Replicability;2023-06-27
2. Migrating gradual types;Journal of Functional Programming;2022
3. Casts and costs: harmonizing safety and performance in gradual typing;Proceedings of the ACM on Programming Languages;2018-07-30
4. Migrating gradual types;Proceedings of the ACM on Programming Languages;2018-01