Lune

PLDI2022Top-tier venue

Deep and shallow types for gradual languages

Ben Greenman

Abstract

Sound gradual types come in many forms and offer varying levels of soundness. Two extremes are deep types and shallow types. Deep types offer compositional guarantees but depend on expensive higher-order contracts. Shallow types enforce only local properties, but can be implemented with first-order checks. This paper presents a language design that supports both deep and shallow types to utilize their complementary strengths.

In the mixed language, deep types satisfy a strong complete monitoring guarantee and shallow types satisfy a firstorder notion of type soundness. The design serves as the blueprint for an implementation in which programmers can easily switch between deep and shallow to leverage their distinct advantages. On the GTP benchmark suite, the median worst-case overhead drops from several orders of magnitude down to 3x relative to untyped. Where an exhaustive search is feasible, 40% of all configurations run fastest with a mix of deep and shallow types.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

2 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Transitioning from structural to nominal code with efficient gradual typing cites Corpse reviver: sound and efficient gradual typing via contract verification
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers2

  1. Denotational Semantics of Gradual Typing using Synthetic Guarded Domain TheoryEric Giovannini, Tingting Ding, Max S. NewPOPL 2025 · 2 citations
  2. Gradually Typed Languages Should Be Vigilant!Olek Gierczak, Lucy Menon, Christos Dimoulas, Amal AhmedOOPSLA 2024 · 1 citation

Builds on2

  1. Corpse reviver: sound and efficient gradual typing via contract verificationCameron Moy, Phuc C. Nguyen, Sam Tobin-Hochstadt, David Van HornPOPL 2021 · 16 citations
  2. Transitioning from structural to nominal code with efficient gradual typingFabian Muehlboeck, Ross TateOOPSLA 2021 · 8 citations

Related papers

  1. Abstracting gradual typing moving forward: precise and space-efficientFelipe Bañados Schwerter, Alison M. Clark, Khurram A. Jafery, Ronald GarciaPOPL 2021 · 13 citations
  2. How Profilers Can Help Navigate Type MigrationBen Greenman, Matthias Felleisen, Christos DimoulasOOPSLA 2023 · 1 citation
  3. Merging Gradual TypingWenjia Ye, Bruno C. d. S. Oliveira, Matías ToroOOPSLA 2024 · 2 citations
  4. Fully abstract from static to gradualKoen Jacobs, Amin Timany, Dominique DevriesePOPL 2021 · 14 citations
  5. Type-Based Gradual Typing Performance OptimizationJohn Peter Campora III, Mohammad Wahiduzzaman Khan, Sheng ChenPOPL 2024 · 3 citations
Dusk over the sea between two cliffs drawn in fine vertical lines