Native Implementation of Mutable Value Semantics

by   Dimitri Racordon, et al.

Unrestricted mutation of shared state is a source of many well-known problems. The predominant safe solutions are pure functional programming, which bans mutation outright, and flow sensitive type systems, which depend on sophisticated typing rules. Mutable value semantics is a third approach that bans sharing instead of mutation, thereby supporting part-wise in-place mutation and local reasoning, while maintaining a simple type system. In the purest form of mutable value semantics, references are second-class: they are only created implicitly, at function boundaries, and cannot be stored in variables or object fields. Hence, variables can never share mutable state. Because references are often regarded as an indispensable tool to write efficient programs, it is legitimate to wonder whether such a discipline can compete other approaches. As a basis for answering that question, we demonstrate how a language featuring mutable value semantics can be compiled to efficient native code. This approach relies on stack allocation for static garbage collection and leverages runtime knowledge to sidestep unnecessary copies.



There are no comments yet.


page 1

page 2

page 3

page 4


The Move Borrow Checker

The Move language provides abstractions for programming with digital ass...

Don't Unroll Adjoint: Differentiating SSA-Form Programs

This paper presents reverse-mode algorithmic differentiation (AD) based ...

Factorisation systems for logical relations and monadic lifting in type-and-effect system semantics

Type-and-effect systems incorporate information about the computational ...

Implementing implicit OpenMP data sharing on GPUs

OpenMP is a shared memory programming model which supports the offloadin...

Efficient Gradual Typing

Gradual typing combines static and dynamic typing in the same program. O...

Understanding Lua's Garbage Collection – Towards a Formalized Static Analyzer

We provide the semantics of garbage collection (GC) for the Lua programm...

Descartes: A PITest Engine to Detect Pseudo-Tested Methods - Tool Demonstration

Descartes is a tool that implements extreme mutation operators and aims ...
This week in AI

Get the week's most popular data science and artificial intelligence research sent straight to your inbox every Saturday.