Ruminating about mutable value semantics
The article discusses the challenges of designing a programming language called zest that balances efficiency and value semantics. It explores the concept of mutable value semantics, which allows mutation while preventing observable mutable references. Three approaches to enforce aliasing rules are examined: implicit copies, dynamic alias tracking, and static alias tracking, each with its own advantages and drawbacks.
- ▪Zest aims to be an efficient imperative language while treating values as data.
- ▪Mutable value semantics allows mutation without observable mutable references.
- ▪Three methods to enforce aliasing rules include implicit copies, dynamic alias tracking, and static alias tracking.
Opening excerpt (first ~120 words) tap to expand
(This is part of a series on the design of zest. See the list of posts here.) I have two goals for zest that are in tension: Be a reasonably efficient imperative language (eg go, julia). Treat values as data (eg erlang, clojure, see the shape of data). In particular, for goal 2 I want to guarantee that deserialize(serialize(x)) == x . It's tricky to satisfy both goals, because as soon as you allow mutable references you can create circular data-structures and have to deal with questions of identity vs value.
…
Excerpt limited to ~120 words for fair-use compliance. The full article is at Scattered-thoughts.