Implementing a language with explicit assignment semantics

Anzen is a multi-paradigm programming language that aims to provide explicit and controllable assignment semantics. It is based on the observation that abstractions over memory management and data representation, as commonly adopted by contemporary programming languages, often transpire relics of the underlying memory model and lead to confusing assignment semantics in the presence of aliases. In response, Anzen’s goal is to offer a modern approach to programming, built on a sound and unambiguous semantics.This paper describes the implementation of a compiler for Anzen. Our implementation transpiles sources to an intermediate language inspired by the LLVM IR, designed to ease further analysis on Anzen’s statements. This intermediate representation is then consumed by a register-based virtual machine. We present the Anzen compiler’s architecture, introduce its intermediate language and describe the latter’s evaluation. Our work aims to set a reference implementation for future developments and extensions of the language.

[1]  James Goodwill,et al.  The Swift Programming Language , 2015 .

[2]  Paul Hudak,et al.  Call by name, assignment, and the lambda calculus , 1993, POPL '93.

[3]  Matthew J. Parkinson,et al.  Uniqueness and reference immutability for safe parallelism , 2012, OOPSLA '12.

[4]  David E. Culler,et al.  Ownership is theft: experiences building an embedded OS in rust , 2015, PLOS@SOSP.

[5]  Simon L. Peyton Jones,et al.  SHErrLoc: A Static Holistic Error Locator , 2017, ACM Trans. Program. Lang. Syst..

[6]  John Tang Boyland,et al.  Capabilities for Sharing: A Generalisation of Uniqueness and Read-Only , 2001, ECOOP.

[7]  Peter J. Stuckey,et al.  Type Processing by Constraint Reasoning , 2006, APLAS.

[8]  Karel Driesen,et al.  Software and Hardware Techniques for Efficient Polymorphic Calls , 1999 .

[9]  John C. Reynolds Definitional Interpreters for Higher-Order Programming Languages , 1998, High. Order Symb. Comput..

[10]  Benjamin C. Pierce,et al.  Local type inference , 2000, TOPL.

[11]  Vikram S. Adve,et al.  LLVM: a compilation framework for lifelong program analysis & transformation , 2004, International Symposium on Code Generation and Optimization, 2004. CGO 2004..

[12]  David Gregg,et al.  The case for virtual register machines , 2003, IVME '03.

[13]  Jurriaan Hage,et al.  Generalizing Hindley-Milner Type Inference Algorithms , 2002 .

[14]  Mark P. Jones,et al.  First-class polymorphism with type inference , 1997, POPL '97.

[15]  Didier Buchs,et al.  Explicit and Controllable Assignment Semantics , 2019, ArXiv.

[16]  John Tang Boyland,et al.  Checking Interference with Fractional Permissions , 2003, SAS.

[17]  Martin Odersky,et al.  Compiling generics through user-directed type specialization , 2009, ICOOOLPS@ECOOP.

[18]  Nicu G. Fruja The Correctness of the Definite Assignment Analysis in C# , 2004, J. Object Technol..

[19]  Mark N. Wegman,et al.  Efficiently computing static single assignment form and the control dependence graph , 1991, TOPL.

[20]  Riccardo Pucella,et al.  Practical affine types , 2011, POPL '11.