ThingLab then and now

ThingLab was a system I built for my Ph.D. dissertation research. It was a constraint-oriented simulation laboratory, originally implemented in Smalltalk-76, that let the user build graphical objects representing such things as electrical circuits, geometric constructions, or documents with constraints on layout and contents. After experimenting with electrical circuits, I realized the same idea could be used for programming language elements (e.g., rather than a resistor with two leads, you could have a Plus object with three leads terminating in numbers, which would enforce the plus constraint among the three numbers).

I thought the source code for the system was lost many years ago, but it turns out that I had put everything on an Alto disk pack, and someone bought that pack, along with a trove of many others, from a surplus store in the Bay Area. Vanessa Freudenberg and Dan Ingalls implemented a Smalltalk-78 VM in Javascript, and we were then able to run the original source code in a modern browser in 2015.

Still more recently (summer 2026), I did a TypeScript reproduction of the original system, again running in the browser. This started as a small experiment in trying out AI-assisted software development but got out of hand.

Poke at the original if you're curious to see what it looked like on an Alto in 1979, but mostly experiment with the TypeScript reproduction -- it will be more fun!

There are some basic directions for running the TypeScript reproduction in the README file for its source code (scroll down on the gitlab page).

The reproduction is intended to keep the look and feel of the original, but (a) to work reliably -- for example, the implementation of the relaxation algorithm in the original had numerical stability problems if you made too large a change -- and (b) to incorporate subsequent research on formalizing hard and soft constraints, change over time, and new constraint solvers. The reproduction currently includes three constraint solvers: DeltaBlue for local propagation, Cassowary for linear equalities and inequalities, and relaxation for other numeric constraints. The architecture for cooperating solvers is new and will hopefully be useful for modern UI applications as well -- I'll write a longer description of it later.

Some screenshots

[image of a voltage divider built using ThingLab] [image of a temperature converter built using ThingLab]

back to home page