Live 2D Compositional Programming

Abstract

This system started out as an experiment in making an obtuse programming paradigm more approachable. Sometimes regarded as “write-only languages”, stack-based concatenative languages rely on implicit argument passing and return values, with programs often just a bare sequence of function names, but they provide a very concise expression of pipelines.

A two-dimensional layout showing both the functions and the corresponding values on the stack could help to make clear where values are coming from and going. Having built it, though, it turned out to naturally express programs outside of that paradigm as well—and perhaps more usefully. In fact, artificial restrictions were necessary to ensure that programs did remain concatenative, while the non-concatenative constructions had clear meaning.

This system lends itself to live editing of a program and displaying intermediate (and final) values throughout, and to exposing exactly the operations that are available at any given time. The following sections will discuss the background, demonstrate usage, explore what can be done with it, and divert to investigating the uncovered semantics of the language.

Authors

Michael Homer

Published in

Workshop on Live Programming (LIVE), 2022

Resources

Michael Homer — 2024 2b418cbd