Solver-based gradual type migration
Solver-based gradual type migration
复制标题
基于求解器的渐进式迁移
DOI:
10.1145/3485488
复制
发表时间:
2021
影响因子:
--
通讯作者:
Guha, Arjun
中科院分区:
文献类型:
--
作者:
Phipps-Costin, Luna;Anderson, Carolyn Jane;Greenberg, Michael;Guha, Arjun
Gradually typed languages allow programmers to mix statically and dynamically typed code, enabling them to incrementally reap the benefits of static typing as they add type annotations to their code. However, this type migration process is typically a manual effort with limited tool support. This paper examines the problem of automated type migration: given a dynamic program, infer additional or improved type annotations. Existing type migration algorithms prioritize different goals, such as maximizing type precision, maintaining compatibility with unmigrated code, and preserving the semantics of the original program. We argue that the type migration problem involves fundamental compromises: optimizing for a single goal often comes at the expense of others. Ideally, a type migration tool would flexibly accommodate a range of user priorities. We present TypeWhich, a new approach to automated type migration for the gradually-typed lambda calculus with some extensions. Unlike prior work, which relies on custom solvers, TypeWhich produces constraints for an off-the-shelf MaxSMT solver. This allows us to easily express objectives, such as minimizing the number of necessary syntactic coercions, and constraining the type of the migration to be compatible with unmigrated code. We present the first comprehensive evaluation of GTLC type migration algorithms, and compare TypeWhich to four other tools from the literature. Our evaluation uses prior benchmarks, and a new set of "challenge problems." Moreover, we design a new evaluation methodology that highlights the subtleties of gradual type migration. In addition, we apply TypeWhich to a suite of benchmarks for Grift, a programming language based on the GTLC. TypeWhich is able to reconstruct all human-written annotations on all but one program.
登录
查看更多内容
影响因子:
--
作者:
Castagna, Giuseppe;Lanvin, Victor;Petrucciani, Tommaso;Siek, Jeremy G.
通讯作者:
Siek, Jeremy G.
影响因子:
--
作者:
Campora, John Peter;Chen, Sheng;Walkingshaw, Eric
通讯作者:
Walkingshaw, Eric
DOI:
--
发表时间:
2014
期刊:
Software Engineering & Management
影响因子:
--
作者:
Zvonimir Pavlinovic;Tim King;Thomas Wies
通讯作者:
Thomas Wies
DOI:
10.1007/s10990-011-9066-z
发表时间:
2010
期刊:
Higher-Order and Symbolic Computation
影响因子:
--
作者:
David Herman;Aaron Tomb;C. Flanagan
通讯作者:
C. Flanagan
DOI:
10.1145/2908080.2908127
发表时间:
2016
期刊:
Proceedings of the 37th ACM SIGPLAN Conference on Programming Language Design and Implementation
影响因子:
--
作者:
Brianna M. Ren;J. Foster
通讯作者:
J. Foster