Native Implementation of Mutable Value Semantics

06/23/2021
by   Dimitri Racordon, et al.
0

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.

READ FULL TEXT
POST COMMENT

Comments

There are no comments yet.

Authors

page 1

page 2

page 3

page 4

05/10/2022

The Move Borrow Checker

The Move language provides abstractions for programming with digital ass...
10/18/2018

Don't Unroll Adjoint: Differentiating SSA-Form Programs

This paper presents reverse-mode algorithmic differentiation (AD) based ...
04/10/2018

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

Type-and-effect systems incorporate information about the computational ...
11/28/2017

Implementing implicit OpenMP data sharing on GPUs

OpenMP is a shared memory programming model which supports the offloadin...
02/18/2018

Efficient Gradual Typing

Gradual typing combines static and dynamic typing in the same program. O...
05/26/2020

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

We provide the semantics of garbage collection (GC) for the Lua programm...
11/07/2018

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.