Solver-based Gradual Type Migration

LUNA PHIPPS-COSTIN, University of Massachusetts Amherst, United States
CAROLYN JANE ANDERSON, Wellesley College, United States
MICHAEL GREENBERG, Pomona College, United States
ARJUN GUHA, Northeastern University, United States

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.

You shouldn't see the bottom of this document.