Affiliation:
1. University of Chile, Santiago, Chile
Abstract
Gradual typing enables a smooth and progressive integration of static and dynamic typing. The semantics of a gradually-typed program is given by translation to an intermediate language with casts: runtime type checks that control the boundaries between statically- and dynamically-typed portions of a program. This paper studies the performance of different cast insertion strategies in the context of Gradualtalk, a gradually-typed Smalltalk. We first implement the strategy specified by Siek and Taha, which inserts casts at call sites. We then study the dual approach, which consists in performing casts in callees. Based on the observation that both strategies perform well in different scenarios, we design a hybrid strategy that combines the best of each approach. We evaluate these three strategies using both micro- and macro-benchmarks. We also discuss the impact of these strategies on memory, modularity, and inheritance. The hybrid strategy constitutes a promising cast insertion strategy for adding gradual types to existing dynamically-typed languages.
Publisher
Association for Computing Machinery (ACM)
Subject
Computer Graphics and Computer-Aided Design,Software
Reference42 articles.
1. Soft typing
2. Strongtalk
3. Hybrid type checking
4. S. Tobin-Hochstadt Typed Scheme: From Scripts to Programs Ph.D. thesis Northeastern University (Jan. 2010). S. Tobin-Hochstadt Typed Scheme: From Scripts to Programs Ph.D. thesis Northeastern University (Jan. 2010).
Cited by
1 articles.
订阅此论文施引文献
订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献
1. Complete monitors for gradual types;Proceedings of the ACM on Programming Languages;2019-10-10