Polymorphic Reachability Types: Tracking Freshness, Aliasing, and Separation in Higher-Order Generic Programs (SIGPLAN)
Fueled by the success of Rust, many programming languages are adding substructural features to their type systems. The promise of tracking properties such as lifetimes and sharing is tremendous, not just for low-level memory management, but also for controlling higher-level resources and capabilities. But so are the difficulties in adapting successful techniques from Rust to higher-level languages, where they need to interact with other advanced features, especially various flavors of functional and type-level abstraction. What would it take to bring full-fidelity reasoning about lifetimes and sharing to mainstream languages? Reachability types are a recent proposal that has shown promise in scaling to higher-order but monomorphic settings, tracking aliasing and separation on top of a substrate inspired by separation logic. However, naive extensions on top of the prior reachability type system λ* with type polymorphism and/or precise reachability polymorphism are unsound, making λ* unsuitable for adoption in real languages. Combining reachability and type polymorphism that is precise, sound, and parametric remains an open challenge.
This paper presents a rethinking of the design of reachability tracking and proposes new polymorphic reachability type systems. We introduce a new freshness qualifier to indicate variables whose reachability sets may grow during evaluation steps. The new system tracks variables reachable in a single step and computes transitive closures only when necessary, thus preserving chains of reachability over known variables that can be refined using substitution. These ideas yield the simply-typed λ✦-calculus with precise lightweight, i.e., quantifier-free, reachability polymorphism, and the F<:✦-calculus with bounded parametric polymorphism over types and reachability qualifiers, paving the way for making true tracking of lifetimes and sharing practical for mainstream languages. We prove type soundness and the preservation of separation property in Coq. We discuss various applications (e.g., safe capability programming), possible effect system extensions, and compare our system with Scala’s capture types.
Thu 24 OctDisplayed time zone: Pacific Time (US & Canada) change
16:00 - 17:40 | Types and Gradual Typing 1OOPSLA 2024 at IBR West Chair(s): Fabian Muehlboeck Australian National University | ||
16:00 20mTalk | Intensional Functions OOPSLA 2024 Zachary Palmer Swarthmore College, Nathaniel Wesley Filardo Microsoft, Ke Wu Johns Hopkins University DOI | ||
16:20 20mTalk | Qualifying System F-sub OOPSLA 2024 Edward Lee University of Waterloo, Yaoyu Zhao University of Waterloo, Ondřej Lhoták University of Waterloo, James You University of Waterloo, Kavin Satheeskumar University of Waterloo, Jonathan Immanuel Brachthäuser University of Tübingen DOI | ||
16:40 20mTalk | Refinement Type Refutations OOPSLA 2024 Robin Webbers Vrije Universiteit Amsterdam, Klaus von Gleissenthall Vrije Universiteit Amsterdam, Ranjit Jhala UCSD DOI | ||
17:00 20mTalk | Type Inference Logics OOPSLA 2024 DOI | ||
17:20 20mTalk | Polymorphic Reachability Types: Tracking Freshness, Aliasing, and Separation in Higher-Order Generic Programs (SIGPLAN) OOPSLA 2024 Guannan Wei Inria/ENS; Tufts University, Oliver Bračevac EPFL, LAMP, Songlin Jia Purdue University, USA, Yuyan Bao Augusta University, Tiark Rompf Purdue University Link to publication |