Refined Criteria for Gradual Typing
نویسندگان
چکیده
Siek and Taha [2006] coined the term gradual typing to describe a theory for integrating static and dynamic typing within a single language that 1) puts the programmer in control of which regions of code are statically or dynamically typed and 2) enables the gradual evolution of code between the two typing disciplines. Since 2006, the term gradual typing has become quite popular but its meaning has become diluted to encompass anything related to the integration of static and dynamic typing. This dilution is partly the fault of the original paper, which provided an incomplete formal characterization of what it means to be gradually typed. In this paper we draw a crisp line in the sand that includes a new formal property, named the gradual guarantee, that relates the behavior of programs that differ only with respect to their type annotations. We argue that the gradual guarantee provides important guidance for designers of gradually typed languages. We survey the gradual typing literature, critiquing designs in light of the gradual guarantee. We also report on a mechanized proof that the gradual guarantee holds for the Gradually Typed Lambda Calculus. 1998 ACM Subject Classification F.3.3 Studies of Program Constructs – Type structure
منابع مشابه
Gradual Refinement Types Extended Version with Proofs
Refinement types are an effective language-based verification technique. However, as any expressive typing discipline, its strength is its weakness, imposing sometimes undesired rigidity. Guided by abstract interpretation, we extend the gradual typing agenda and develop the notion of gradual refinement types, allowing smooth evolution and interoperability between simple types and logicallyrefin...
متن کاملA Gradual Interpretation of Union Types
Union types allow to capture the possibility of a term to be of several possibly unrelated types. Traditional static approaches to union types are untagged and tagged unions, which present dual advantages in their use. Inspired by recent work on using abstract interpretation to understand gradual typing, we present a novel design for union types, called gradual union types. Gradual union types ...
متن کاملConsistent Subtyping for All
Consistent subtyping is employed in some gradual type systems to validate type conversions. The original definition by Siek and Taha serves as a guideline for designing gradual type systems with subtyping. Polymorphic types à la System F also induce a subtyping relation that relates polymorphic types to their instantiations. However Siek and Taha’s definition is not adequate for polymorphic sub...
متن کاملMethadone Detoxification versus Traditional Gradual Decrease in the Consumed Amount of Refined Opium Dross (Shireh): The Preferred Method for Controlling Withdrawal Syndrome
Background: The aim of this study was to compare the effectiveness of methadone detoxification with traditional method of gradual decrement in the abused amount of the refined opium dross (Shireh) to control withdrawal syndrome in Shireh-addicted patients. Methods: In this study, two groups of Shireh addicts were compared. The first group was treated by methadone and the second group by gr...
متن کاملFrom Optional to Gradual Typing via Transient Checks
Gradual typing [11, 16] has seen widespread use over the last several years, in both academic research [1, 2, 9, 10, 12–14] and industrial language design [5, 6, 8]. Many recent implementations of gradual typing are translations to an existing untyped target language. Some of these translation do not perform runtime checking, which is needed for gradual soundness, in part because of the complex...
متن کامل