Reference. FabULous Interoperability for ML and a Linear Language
Instead of a monolithic programming language trying to cover all features of interest, some programming systems are designed by combining together simpler languages that cooperate to cover the same feature space. This can improve usability by making each part simpler than the whole, but there is a risk of abstraction leaks from one language to another that would break expectations of the users familiar with only one or some of the involved languages.
We propose a formal specification for what it means for a given language in a multi-language system to be usable without leaks: it should embed into the multi-language in a fully abstract way, that is, its contextual equivalence should be unchanged in the larger system.
To demonstrate our proposed design principle and formal specification criterion, we design a multi-language programming system that combines an ML-like statically typed functional language and another language with linear types and linear state. Our goal is to cover a good part of the expressiveness of languages that mix functional programming and linear state (ownership), at only a fraction of the complexity. We prove that the embedding of ML into the multi-language system is fully abstract: functional programmers should not fear abstraction leaks. We show examples of combined programs demonstrating in-place memory updates and safe resource handling, and an implementation extending OCaml with our linear language.
Cite
Cited by (1)
Multi-Language Probabilistic Programming stites-2025-multi
Cites 29 works (1 here)
With notes (1)
Fully Abstract Compilation via Universal Embedding new_bowman_ahmed_2016
A fully abstract compiler guarantees that two source components are observationally equivalent in the source language if and only if their translations are observationally equivalent in the target. Full abstraction implies the translation is secure: target-language attackers can make no more observations of a compiled component than a source-language attacker interacting with the original source component. Proving full abstraction for realistic compilers is challenging because realistic target languages contain features (such as control effects) unavailable in the source, while proofs of full abstraction require showing that every target context to which a compiled component may be linked can be back-translated to a behaviorally equivalent source context.
We prove the first full abstraction result for a translation whose target language contains exceptions, but the source does not. Our translation—specifically, closure conversion of simply typed λ-calculus with recursive types—uses types at the target level to ensure that a compiled component is never linked with attackers that have more distinguishing power than source-level attackers. We present a new back-translation technique based on a shallow embedding of the target language into the source language at a dynamic type. Then boundaries are inserted that mediate terms between the untyped embedding and the strongly-typed source. This technique allows back-translating non-terminating programs, target features that are untypeable in the source, and well-bracketed effects.
External (28)
- Linear haskell: practical linearity in a higher-order polymorphic language (2018)
- Fun-TAL: Reasonably mixing a functional language with assembly (2017)
- The design and formalization of Mezzo, a permission-based programming language (2016)
- Fine-grained language composition: A case study (2016)
- Fully-abstract compilation by approximate back-translation (2016)
- The best of both worlds: Linear functional programming without compromise (2016)
- Refinement through restraint: Bringing down the cost of verification (2016)
- Secure compilation to protected module architectures (2015)
- Foundations of typestate-oriented programming (2014)
- Verifying an open compiler using multi-language semantics (2014)
- Resource Aware ML (2012)
- Dependent inter-operability (2012)
- An equivalence-preserving CPS translation via multi-language semantics (2011)
- Practical affine types (2011)
- Stateful contracts for affine types (2010)
- Operational semantics for multi-language programs (2009)
- Typed closure conversion preserves observational equivalence (2008)
- L3: A linear language with locations (2007)
- Java Jr.: Fully abstract trace semantics for a core Java language (2005)
- The teachscheme! project: Computing and programming for every student (2004)
- Adoption and focus: Practical linear types for imperative programming (2002)
- Full abstraction for PCF (2000)
- A mixed linear and non-linear logic: Proofs, terms and models (1994)
- A logic for parametric polymorphism (1993)
- Observable sequentiality and full abstraction (1992)
- Linear Types Can Change the World! (1990)
- Towards fully abstract semantics for local variables (1988)
- Fully abstract models of typed lambda calculi (1977)