Typestate via Revocable Capabilities
summary
Presents a Scala 3 compiler extension (prototype in Stella) that implements flow-sensitive revocation, ties capabilities to objects via path-dependent capabilities, and returns capabilities implicitly to avoid boilerplate. Implements files, hand‑over‑hand locking, well‑formed DOM trees and binary session types; control‑flow combinators handle branches and loops. Benchmarks show capture‑checking and effect tracking add modest compiler overhead (depths 17–33) comparable to other phases. Artifacts are available and examples compile and statically prevent stale or misrouted capability use.
AI-written summary · about
chapters (12)
- 0:00Typestate via revocable capabilities
- 1:27Motivating typestate tracking
- 2:33Existing solutions and limits
- 3:35Lightweight Scala approach
- 4:39Naive typestate problems
- 5:43Three pillars of solution
- 6:49Pass-dependent capabilities
- 7:51Flow-sensitive implicits
- 8:52Complex control flow
- 10:36Performance overhead
- 11:19Summary and validation
- 12:03Q&A
related talks
30mConstraint Typing with Boolean Algebra
16mWhat's in the Box: Ergonomic and Expressive Capture Tracking over Generic Data(…)
44mTelling the Truth with Types
20mTaming UI complexity with Typed State Machines
49mThe Trouble With Types
50mReification and type-safety in a CQRS world
40mFunction-Passing, A New Model for Typed, Asynchronous and Distributed Programming
50mSimple code for a type safe world
