FabULous Interoperability for ML and a Linear Language

07/17/2017
by   Gabriel Scherer, et al.
0

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.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
04/17/2018

K-Rust: An Executable Formal Semantics for Rust

Rust is a system programming language designed for providing better memo...
research
08/09/2019

Functional programming with lambda-tree syntax

We present the design of a new functional programming language, MLTS, th...
research
10/21/2019

Transparent Synchronous Dataflow

There are several functional approaches to dataflow programming, produce...
research
06/19/2019

Transformation of XML Documents with Prolog

Transforming XML documents with conventional XML languages, like XSL-T, ...
research
08/26/2019

Kindly Bent to Free Us

Systems programming often requires the manipulation of resources like fi...
research
03/07/2018

Resource Polymorphism

We present a resource-management model for ML-style programming language...
research
07/13/2023

Typed Design Patterns for the Functional Era

This paper explores how design patterns could be revisited in the era of...

Please sign up or login with your details

Forgot password? Click here to reset