What Price for Eliminating Expression Side-effects?

Separating a programming language into side-effect-free expressions and effect-only statements should make the language more amenable to axiomatization, as well as providing benefits for style, pedagogy, and implementation efficiency (particularly in parallel-computing environments). This paper show...

Full description

Bibliographic Details
Main Author: Hailperin, Max
Published: 2023
Online Access:https://hdl.handle.net/1721.1/149090
Description
Summary:Separating a programming language into side-effect-free expressions and effect-only statements should make the language more amenable to axiomatization, as well as providing benefits for style, pedagogy, and implementation efficiency (particularly in parallel-computing environments). This paper shows that such a division does not come at an unreasonable cost in programming convenience. First a dialect of Lisp is defined, in which a distinction is made between statements, which may have side-effects, and expressions, which may not. Next, a representative collection of examples from Abelson and Sussman's Structure and Interpretation of Computer Programs is coded in this dialect of Lisp. Most of the examples divide neatly into functional and imperative portions, and a few relatively clean transformations prove sufficient for the more stubborn cases.