Lune

POPL2021Top-tier venue

A practical mode system for recursive definitions

Alban Reynaud, Gabriel Scherer, Jeremy Yallop

Abstract

In call-by-value languages, some mutually-recursive definitions can be safely evaluated to build recursive functions or cyclic data structures, but some definitions (let rec x = x + 1) contain vicious circles and their evaluation fails at runtime. We propose a new static analysis to check the absence of such runtime failures.

We present a set of declarative inference rules, prove its soundness with respect to the reference sourcelevel semantics of Nordlander, Carlsson, and Gill [2008], and show that it can be directed into an algorithmic backwards analysis check in a surprisingly simple way.

Our implementation of this new check replaced the existing check used by the OCaml programming language, a fragile syntactic criterion which let several subtle bugs slip through as the language kept evolving. We document some issues that arise when advanced features of a real-world functional language (exceptions in first-class modules, GADTs, etc.) interact with safety checking for recursive definitions.

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

Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers2

  1. flap: A Deterministic Parser with Fused LexingJeremy Yallop, Ningning Xie, Neel KrishnaswamiPLDI 2023 · 10 citations
  2. A type-and-effect system for object initializationFengyun Liu, Ondrej Lhoták, Aggelos Biboudis, Paolo G. Giarrusso et al.OOPSLA 2020 · 8 citations

Related papers

  1. Unboxed Data Constructors: Or, How cpp Decides a Halting ProblemNicolas Chataing, Stephen Dolan, Gabriel Scherer, Jeremy YallopPOPL 2024 · 3 citations
  2. Predictable Verification using Intrinsic DefinitionsAdithya Murali, Cody Rivera, P. MadhusudanPLDI 2024 · 2 citations
  3. Language-Agnostic Static Deadlock Detection for FuturesStefan K. MullerPPoPP 2024 · 1 citation
  4. Data-driven abductive inference of library specificationsZhe Zhou, Robert Dickerson, Benjamin Delaware, Suresh JagannathanOOPSLA 2021 · 15 citations
  5. Type Inference LogicsDenis Carnier, François Pottier, Steven KeuchelOOPSLA 2024 · 3 citations
Dusk over the sea between two cliffs drawn in fine vertical lines