March 2022

Acquiring a resource

by Bret Victor

This entry is a stub, and will be expanded on a future archiving pass.

Realtalk rules almost never have side effects. But side effects are necessary for interfacing with hardware resources, and doing so safely had been a longstanding challenge, because rules can run in arbitrary order and even multiple times as convergence proceeds.

Part of the answer was ”convergence priorities”, introduced with Realtalk-2020’s reactor, which gave control over the order in which rules were evaluated.

The other part of the answer was “acquiring a resource”, which orders the matching and unmatching of a rule in such a way that resources are only released after their derived resources are released and there are no more statements about them.

Rules reacting to hardware resources could now be written in the most natural way, making it much easier for Realtalk to go “all the way down”, as well as support hot-plugged devices.

Motivated by GPU Kit (2022).