Lune

OOPSLA2021顶会

Solver-based gradual type migration

Luna Phipps-Costin, Carolyn Jane Anderson, Michael Greenberg, Arjun Guha

摘要

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.

问 Lune

几分钟读透这篇 Paper,不用再花一下午。

Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。

已有 8 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。

可以从这些问题问起

Lune 可以查阅

全文 · 引用它的顶会 Paper · 相关的 Paper

获取答案

免费开始,无需绑卡

脉络

  • Practical Inference of Nullability Types 引用了 What is decidable about gradual types?
  • Practical Inference of Nullability Types 引用了 Pluggable Type Inference for Free
  • Practical Inference of Nullability Types 引用了 TypeWriter: neural type prediction with search-based validation
  • Typed and Confused: Studying the Unexpected Dangers of Gradual Typing 引用了 TypeWriter: neural type prediction with search-based validation
  • C to checked C by 3c 引用了 What is decidable about gradual types?
  • Pluggable Type Inference for Free 引用了 TypeWriter: neural type prediction with search-based validation
它引用的引用它的从左到右按年份排列,引用越多,位置越高。

引用它的顶会 Paper8

  1. C to checked C by 3cAravind Machiry, John H. Kastner, Matt McCutchen, Aaron Eline 等OOPSLA 2022 · 20 次引用
  2. Practical Inference of Nullability TypesNima Karimipour, Justin Pham, Lazaro Clapp, Manu SridharanFSE 2023 · 6 次引用
  3. Pluggable Type Inference for FreeMartin Kellogg, Daniel Daskiewicz, Loi Ngo Duc Nguyen, Muyeed Ahmed 等ASE 2023 · 4 次引用
  4. A Gradual Probabilistic Lambda CalculusWenjia Ye, Matías Toro, Federico OlmedoOOPSLA 2023 · 3 次引用
  5. Typed and Confused: Studying the Unexpected Dangers of Gradual TypingDominic Troppmann, Aurore Fass, Cristian-Alexandru StaicuASE 2024 · 2 次引用

它引用的 Paper3

  1. LambdaNet: Probabilistic Type Inference using Graph Neural NetworksJiayi Wei, Maruth Goyal, Greg Durrett, Isil DilligICLR 2020 · 119 次引用
  2. TypeWriter: neural type prediction with search-based validationMichael Pradel, Georgios Gousios, Jason Liu, Satish ChandraFSE 2020 · 102 次引用
  3. What is decidable about gradual types?Zeina Migeed, Jens PalsbergPOPL 2020 · 12 次引用

相关 Paper

  1. Type-Based Gradual Typing Performance OptimizationJohn Peter Campora III, Mohammad Wahiduzzaman Khan, Sheng ChenPOPL 2024 · 3 次引用
  2. Transitioning from structural to nominal code with efficient gradual typingFabian Muehlboeck, Ross TateOOPSLA 2021 · 8 次引用
  3. Merging Gradual TypingWenjia Ye, Bruno C. d. S. Oliveira, Matías ToroOOPSLA 2024 · 2 次引用
  4. Abstracting gradual typing moving forward: precise and space-efficientFelipe Bañados Schwerter, Alison M. Clark, Khurram A. Jafery, Ronald GarciaPOPL 2021 · 13 次引用
  5. Taming type annotations in gradual typingJohn Peter Campora III, Sheng ChenOOPSLA 2020 · 7 次引用
黄昏的海面,两侧是细线勾勒的悬崖