Realistic Realizability: Specifying ABIs You Can Count On
Open Access
- 8 October 2024
- journal article
- research article
- Published by Association for Computing Machinery (ACM) in Proceedings of the ACM on Programming Languages
- Vol. 8 (OOPSLA2) , 1249-1278
Abstract
The Application Binary Interface (ABI) for a language defines the interoperability rules for its target platforms, including data layout and calling conventions, such that compliance with the rules ensures “safe” execution and perhaps certain resource usage guarantees. These rules are relied upon by compilers, libraries, and foreign- function interfaces. Unfortunately, ABIs are typically specified in prose, and while type systems for source languages have evolved, ABIs have comparatively stalled, lacking advancements in expressivity and safety. We propose a vision for richer, semantic ABIs to improve interoperability and library integration, supported by a methodology for formally specifying ABIs using realizability models. These semantic ABIs connect abstract, high-level types to unwieldy, but well-behaved, low-level code. We illustrate our approach with a case study formalizing the ABI of a functional source language in terms of a reference-counting implementation in a C-like target language. A key contribution supporting this case study is a graph-based model of separation logic that captures the ownership and accessibility of reference-counted resources using modalities inspired by hybrid logic. To highlight the flexibility of our methodology, we show how various design decisions can be interpreted into the semantic ABI. Finally, we provide the first formalization of library evolution, a distinguishing feature of Swift’s ABI.Keywords
Funding Information
- Defense Advanced Research Projects Agency (N66001-21-C-4023)
This publication has 51 references indexed in Scilit:
- Manifest Deadlock-Freedom for Shared Session Types2019
- Starling: Lightweight Concurrency Verification with Views2017
- Tackling Real-Life Relaxed Concurrency with FSL++2017
- Program Logics for Certified Compilers2014
- Verifying Reference Counting Implementations2009
- Intuitionistic hybrid logicJournal of Applied Logic, 2006
- Abstracting AllocationLecture Notes in Computer Science, 2006
- Step-Indexed Syntactic Logical Relations for Recursive and Quantified Types2006
- Local Reasoning about Programs that Alter Data Structures2001
- Unboxed values as first class citizens in a non-strict functional language1991