Lune

OOPSLA2020Top-tier venue

Knowing when to ask: sound scheduling of name resolution in type checkers derived from declarative specifications

Arjen Rouvoet, Hendrik van Antwerpen, Casper Bach Poulsen, Robbert Krebbers, Eelco Visser

Abstract

There is a large gap between the specification of type systems and the implementation of their type checkers, which impedes reasoning about the soundness of the type checker with respect to the specification. A vision to close this gap is to automatically obtain type checkers from declarative programming language specifications. This moves the burden of proving correctness from a case-by-case basis for concrete languages to a single correctness proof for the specification language. This vision is obstructed by an aspect common to all programming languages: name resolution. Naming and scoping are pervasive and complex aspects of the static semantics of programming languages. Implementations of type checkers for languages with name binding features such as modules, imports, classes, and inheritance interleave collection of binding information (i.e., declarations, scoping structure, and imports) and querying that information. This requires scheduling those two aspects in such a way that query answers are stable—i.e., they are computed only after all relevant binding structure has been collected. Type checkers for concrete languages accomplish stability using language-specific knowledge about the type system. In this paper we give a language-independent characterization of necessary and sufficient conditions to guarantee stability of name and type queries during type checking in terms of critical edges in an incomplete scope graph . We use critical edges to give a formal small-step operational semantics to a declarative specification language for type systems, that achieves soundness by delaying queries that may depend on missing information. This yields type checkers for the specified languages that are sound by construction—i.e., they schedule queries so that the answers are stable, and only accept programs that are name- and type-correct according to the declarative language specification. We implement this approach, and evaluate it against specifications of a small module and record language, as well as subsets of Java and Scala.

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.

3 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

  • Language-Parametric Reference Synthesis cites Language-parametric static semantic code completion
  • Incremental type-checking for free: using scope graphs to derive incremental type-checkers cites Language-parametric static semantic code completion
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers3

  1. Language-parametric static semantic code completionDaniël A. A. Pelsmaeker, Hendrik van Antwerpen, Casper Bach Poulsen, Eelco VisserOOPSLA 2022 · 10 citations
  2. Incremental type-checking for free: using scope graphs to derive incremental type-checkersAron Zwaan, Hendrik van Antwerpen, Eelco VisserOOPSLA 2022 · 3 citations
  3. Language-Parametric Reference SynthesisDaniël A. A. Pelsmaeker, Aron Zwaan, Casper Bach Poulsen, Arjan J. MooijOOPSLA 2025 · 1 citation

Related papers

  1. Scalability and precision by combining expressive type systems and deductive verificationFlorian Lanzinger, Alexander Weigl, Mattias Ulbrich, Werner DietlOOPSLA 2021 · 6 citations
  2. First-Class Refinement Types for ScalaMatt Bovel, Viktor Kunčak, Martin OderskyOOPSLA 2026
  3. Undecidability of d<: and its decidable fragmentsJason Z. S. Hu, Ondrej LhotákPOPL 2020 · 9 citations
  4. Decidable subtyping for path dependent typesJulian Mackay, Alex Potanin, Jonathan Aldrich, Lindsay GrovesPOPL 2020 · 13 citations
  5. Classifying CapabilitiesCao Nguyen Pham, Oliver Bračevac, Yichen Xu, Yaoyu Zhao et al.OOPSLA 2026
Dusk over the sea between two cliffs drawn in fine vertical lines