Solver-based Gradual Type Migration
Luna Phipps-Costin, Carolyn Jane Anderson, Michael Greenberg, Arjun, Guha

TL;DR
This paper introduces TypeWhich, an automated type migration tool for gradually typed languages, leveraging off-the-shelf MaxSMT solvers to balance multiple migration goals and improve over prior methods.
Contribution
TypeWhich is the first to use MaxSMT solvers for flexible, multi-goal automated type migration in the GTLC, with comprehensive evaluation and practical application.
Findings
TypeWhich outperforms four existing tools on benchmarks.
It successfully reconstructs human-written annotations in most cases.
The approach allows flexible optimization for various migration objectives.
Abstract
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 \emph{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…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
