Solver-based gradual type migration
نویسندگان
چکیده
Gradually typed languages allow programmers to mix statically and dynamically code, enabling them incrementally reap the benefits of static typing as they add type annotations their code. However, this migration process is typically a manual effort with limited tool support. This paper examines problem automated migration: given dynamic program, infer additional or improved annotations. Existing algorithms prioritize different goals, such maximizing precision, maintaining compatibility unmigrated preserving semantics original program. We argue that involves fundamental compromises: optimizing for single goal often comes at expense others. Ideally, would flexibly accommodate range user priorities. present TypeWhich, new approach gradually-typed lambda calculus some extensions. Unlike prior work, which relies on custom solvers, TypeWhich produces constraints an off-the-shelf MaxSMT solver. allows us easily express objectives, minimizing number necessary syntactic coercions, constraining be compatible first comprehensive evaluation GTLC algorithms, compare four other tools from literature. Our uses benchmarks, set "challenge problems." Moreover, we design methodology highlights subtleties gradual migration. In addition, apply suite benchmarks Grift, programming language based GTLC. able reconstruct all human-written but one
منابع مشابه
Gradual Liquid Type Inference
We present gradual liquid type inference, a novel combination of refinement types with gradual refinements that range over a finite set of SMT-decidable predicates. This finiteness restriction allows for an algorithmic inference procedure where all possibly valid interpretations of a gradual refinement are exhaustively checked. Thanks to exhaustive searching we can detect the safe concretizatio...
متن کاملGradual type-and-effect systems
Effect systems have the potential to help software developers, but their practical adoption has been very limited. We conjecture that this limited adoption is due in part to the difficulty of transitioning from a system where effects are implicit and unrestricted to a system with a static effect discipline, which must settle for conservative checking in order to be decidable. To address this hi...
متن کاملThe process of kidney gradual changes in, Tenualosa ilisha during migration from sea to the river
Abstract In order to study kidney changes in, Tenualosa ilisha during migration from sea to the river, twenty mature T. ilisha specimens were collected from the Persian Gulf (42.7ppt salinity and 29.27°C temperature) and twenty specimens from Arvand River (2.3ppt salinity and 21.16°C temperature). Macroscopic observation indicated that the kidney was located retroperitoneal and attached to...
متن کاملCall-by-name Gradual Type Theory
We present gradual type theory, a logic and type theory for call-by-name gradual typing. We define the central constructions of gradual typing (the dynamic type, type casts and type error) in a novel way, by universal properties relative to new judgments for gradual type and term dynamism, which were developed in blame calculi and to state the “gradual guarantee” theorem of gradual typing. Comb...
متن کاملGradual Typing for Annotated Type Systems
Refinement type systems have been proposed by a number of researchers to sharpen the guarantees of existing type systems. Examples are systems that distinguish empty and non-empty lists by type, taint tracking and information flow control, dimension analysis, and many others. In each case, the type language is extended with annotations that either abstract semantic properties of values beyond t...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
ژورنال
عنوان ژورنال: Proceedings of the ACM on programming languages
سال: 2021
ISSN: ['2475-1421']
DOI: https://doi.org/10.1145/3485488