DeepAI AI Chat
Log In Sign Up

Gradual Typing for Extensibility by Rows

10/18/2019
by   Taro Sekiyama, et al.
0

This work studies gradual typing for row types and row polymorphism. Key ingredients in this work are the dynamic row type, which represents a statically unknown part of a row, and consistency for row types, which allows injecting static row types into the dynamic row type and, conversely, projecting the dynamic row type to any static row type. While consistency captures the behavior of the dynamic row type statically, it makes the semantics of a gradually typed language incoherent when combined with row equivalence which identifies row types up to field reordering. To solve this problem, we develop consistent equivalence, which characterizes composition of consistency and row equivalence. Using consistent equivalence, we propose a polymorphic blame calculus for row types and row polymorphism. In our blame calculus, casts perform not only run-time checking with the dynamic row type but also field reordering in row types. To simplify our technical development for row polymorphism, we adopt scoped labels, which are employed by the language Koka and are also emerging in the context of effect systems. We give the formal definition of our blame calculus with these technical developments and prove its type soundness. We also sketch the gradually typed surface language and type-preserving translation from the surface language to the blame calculus and discuss conservativity of the surface language over typing of a statically typed language with row types and row polymorphism.

READ FULL TEXT

page 1

page 2

page 3

page 4

09/12/2019

Towards Gradually Typed Capabilities in the Pi-Calculus

Gradual typing is an approach to integrating static and dynamic typing w...
10/30/2018

Dynamic Type Inference for Gradual Hindley--Milner Typing

Garcia and Cimini study a type inference problem for the ITGL, an implic...
01/20/2023

System F^μ_ω with Context-free Session Types

We study increasingly expressive type systems, from F^μ – an extension o...
08/13/2021

An ML-style record calculus with extensible records

In this work, we develop a polymorphic record calculus with extensible r...
07/25/2017

An Executable Specification of Typing Rules for Extensible Records based on Row Polymorphism

Type inference is an application domain that is a natural fit for logic ...
03/23/2021

Row-Polymorphic Types for Strategic Rewriting

We present a type system for strategy languages that express program tra...
04/22/2021

On sequentiality and well-bracketing in the π-calculus

The π -calculus is used as a model for programminglanguages. Its context...