A Transient Semantics for Typed Racket

11/19/2021
by   Ben Greenman, et al.
0

Mixed-typed languages enable programmers to link typed and untyped components in various ways. Some offer rich type systems to facilitate the smooth migration of untyped code to the typed world; others merely provide a convenient form of type Dynamic together with a conventional structural type system. Orthogonal to this dimension, Natural systems ensure the integrity of types with a sophisticated contract system, while Transient systems insert simple first-order checks at strategic places within typed code. Furthermore, each method of ensuring type integrity comes with its own blame-assignment strategy. Typed Racket has a rich migratory type system and enforces the types with a Natural semantics. Reticulated Python has a simple structural type system extended with Dynamic and enforces types with a Transient semantics. While Typed Racket satisfies the most stringent gradual-type soundness properties at a significant performance cost, Reticulated Python seems to limit the performance penalty to a tolerable degree and is nevertheless type sound. This comparison raises the question of whether Transient checking is applicable to and beneficial for a rich migratory type system. This paper reports on the surprising difficulties of adapting the Transient semantics of Reticulated Python to the rich migratory type system of Typed Racket. The resulting implementation, Shallow Typed Racket, is faster than the standard Deep Typed Racket but only when the Transient blame assignment strategy is disabled. For language designers, this report provides valuable hints on how to equip an existing compiler to support a Transient semantics. For theoreticians, the negative experience with Transient blame calls for a thorough investigation of this strategy.

READ FULL TEXT
research
02/20/2019

Optimizing and Evaluating Transient Gradual Typing

Gradual typing enables programmers to combine static and dynamic typing ...
research
09/12/2019

Which of My Transient Type Checks Are Not (Almost) Free?

One form of type checking used in gradually typed language is transient ...
research
06/28/2022

Gradual Soundness: Lessons from Static Python

Context: Gradually-typed languages allow typed and untyped code to inter...
research
11/27/2012

On the Use of Underspecified Data-Type Semantics for Type Safety in Low-Level Code

In recent projects on operating-system verification, C and C++ data type...
research
07/02/2018

Shallow Types for Insightful Programs: Grace is Optional, Performance is Not

Languages with explicit dynamic type checking are increasing in populari...
research
01/28/2021

Putting gradual types to work

In this paper, we describe our experience incorporating gradual types in...
research
12/09/2018

Practical Optional Types for Clojure

Typed Clojure is an optional type system for Clojure, a dynamic language...

Please sign up or login with your details

Forgot password? Click here to reset