Destination Calculus: A Linear 𝜆-Calculus for Purely Functional Memory Writes
Destination passing —aka. out parameters— is taking a parameter to fill rather than returning a result from a function. Due to its apparently imperative nature, destination passing has struggled to find its way to pure functional programming. In this paper, we present a pure functional calculus with destinations at its core. Our calculus subsumes all the similar systems, and can be used to reason about their correctness or extension. In addition, our calculus can express programs that were previously not known to be expressible in a pure language. This is guaranteed by a modal type system where modes are used to manage both linearity and scopes. Type safety of our core calculus was proved formally with the Coq proof assistant.
Authors
- Arnaud Spiwack (ORCID: https://orcid.org/0000-0002-5985-2086)
- Thomas Bagrel (ORCID: https://orcid.org/0009-0008-8700-2741)
Institutions
- Laboratoire Lorrain de Recherche en Informatique et ses Applications (FR)
- Centre Inria de l'Université de Lorraine (FR)
Publication Details
- Journal
- Proceedings of the ACM on Programming Languages
- Published
- 2025-04-09
- DOI
- https://doi.org/10.1145/3720423
- Citations
- 1
- Primary Topic
- Logic, programming, and type systems
- Type
- article
- Field-Weighted Citation Impact
- 2.48