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

page 1

page 2

page 3

page 4

research
05/10/2022

The Move Borrow Checker

The Move language provides abstractions for programming with digital ass...
research
12/13/2021

μDep: Mutation-based Dependency Generation for Precise Taint Analysis on Android Native Code

The existence of native code in Android apps plays an essential role in ...
research
10/18/2018

Don't Unroll Adjoint: Differentiating SSA-Form Programs

This paper presents reverse-mode algorithmic differentiation (AD) based ...
research
11/28/2017

Implementing implicit OpenMP data sharing on GPUs

OpenMP is a shared memory programming model which supports the offloadin...
research
09/11/2023

Latte: Lightweight Aliasing Tracking for Java

Many existing systems track aliasing and uniqueness, each with their own...
research
09/15/2022

Coeffects for Sharing and Mutation

In type-and-coeffect systems, contexts are enriched by coeffects modelin...
research
06/30/2018

Flexible recovery of uniqueness and immutability (Extended Version)

We present an imperative object calculus where types are annotated with ...

Please sign up or login with your details

Forgot password? Click here to reset