Simpler User Interfaces with Capability-Passing
summary
A simple terminal user interface framework is implemented in Scala 3 using capability‑passing: layout construction is a capability that makes the call tree become the layout tree vs event graph, and reactive nodes are reified as signals with a deliberate split between create vs observe signals capabilities. The implementation prevents bugs (components must be in the tree, signals can’t leak, signals can only be read in a reactive scope) and the demo failed on the train but the library compiles and enforces those guarantees.
AI-written summary · about
chapters (15)
- 0:00Introduction to capability passing
- 1:52Challenges in user interfaces
- 4:23Reactive style in UIs
- 6:44What are capabilities?
- 9:53Capability passing explained
- 10:14UI capabilities in code
- 13:26Event handling with signals
- 17:22Type system benefits
- 20:38Capture checking and safety
- 22:09General principles beyond UIs
- 24:18Graph structures with capabilities
- 24:40Direct style programming
- 26:25Applications beyond UIs
- 26:45Summary and conclusions
- 27:28Q&A
