PLMar 28

When Lifetimes Liberate: A Type System for Arenas with Higher-Order Reachability Tracking

arXiv:2509.0425311.92 citationsh-index: 34
Predicted impact top 10% in PL · last 90 daysOriginality Highly original
AI Analysis

For programming language designers, this provides a unified approach to static resource management that balances control, expressiveness, and flexibility, addressing limitations of existing systems like Rust and region-based systems.

This work introduces a type system that unifies region-based and ownership-based resource management, enabling first-class heap-allocated resources with three allocation modes while preserving higher-order parametricity. The system is formalized and proven type-safe and memory-safe in Rocq.

Static resource management in languages remains challenging due to tensions among control, expressiveness, and flexibility. Region-based systems [Grossman et al . 2002; Tofte et al. 2001] offer bulk deallocation via lexically scoped regions, where all allocations follow a stack discipline. However, both regions and their resources are second-class, and neither can escape its scope nor be freely returned. Ownership and linear type systems, exemplified by Rust [Clarke et al. 2013], offer non-lexical lifetimes and robust static guarantees, but rely on invariants that limit higher-order patterns and expressive sharing. In this work, we propose a new type system that unifies these strengths. Our system treats all heap-allocated resources as first-class values, while allowing programmers to control lifetime and granularity through three allocation modes: (1) fresh allocation for individual, non-lexical references; (2) subsequent coallocation grouping resources collectively within shadow arenas; and (3) scoped allocation with lexically bounded lifetimes following stack discipline. Regardless of mode, all resources share a uniform type and have no distinction for generic abstractions, preserving the higher-order parametric nature of the language. Obtaining static safety in higher-order languages with flexible sharing is nontrivial. We address this by extending reachability types [Wei et al. 2024] to collectively track first-class resources, and by adopting flow-insensitive deallocation reasoning for selective stack discipline. These mechanisms yield Aq<: and {A}q<: atop, both formalized and proven type safe and memory safe in Rocq.

Foundations

The foundational work for this paper's niche, ranked by how specifically the neighbourhood builds on it — not by global fame.

Your Notes