Lifetime is the span of development or execution during which an abstraction remains present and meaningful. Genericity-like abstractions primarily exist at design and compile time, while interface-like abstractions retain domain meaning during program operation. section 6.1
State lifetime provides a practical way to classify responsibility and persistence:
- Local or auxiliary state exists for one calculation and disappears when that calculation ends. section 7.1
- Operational state lasts roughly as long as the application and supports business logic and important user data. section 7.1
- External state outlives the application by residing in long-term storage such as a database. section 7.1
In an embedded language, a runtime object follows the lifetime of the value that exposes it. A controller available only within a setup scope can be destroyed when interpretation leaves that scope, or deliberately retained afterward. This choice shapes the device model: without a controller, no device is visible to the central computer. section 5.3.1
Scoping a resource safely
The Bracket pattern separates acquisition, release, and use: initialize a resource, perform the action, then dispose of the resource even when the action raises an exception. Nest one bracket per resource rather than grouping several resources under one cleanup function, so already-acquired resources are released in reverse scope order. section 10.3.2
Figure 10.7 Scopes of the resources
Use the resource-scope diagram to compare nested lifetimes and see why each resource should have its own bracket. section 10.3.2







