Catching space leaks at compile-time using th-deepstrict
summary
Claim: laziness only causes unbounded leaks when code is stateful. Examples: a lazy fold that builds a thunk chain, an average accumulator whose top-level state is forced but whose fields accumulate thunks, and a web server with global state that grows without bound. Tool: th-deepstrict uses TemplateHaskell to assert deep strict types by checking for bangs recursively, emitting pretty diagnostics, supporting overrides and golden/ratchet tests. Recommendation: avoid global state or mark state types deep strict and prefer strict containers or strict wrappers for mutable refs.
AI-written summary · about
chapters (9)
- 0:00Space leaks motivation
- 3:16Laziness and thunks causes
- 6:50Deep strictness vs WHNF
- 9:21Statefulness role
- 11:48th-deepstrict introduction
- 15:04Strict data types practice
- 17:30Alternatives trade-offs
- 20:18Conclusion
- 20:45Q&A
related talks
36mWorking Hard to Keep Things Lazy
51mStretching the Glasgow Haskell Compiler: Nourishing GHC with Domain-Driven De...
02h 38mLazy Evaluation
28mLightweight Testing of Persistent Amortized Time Complexity in the Credit Monad
27mTyping Strictness
27mLimiting side-effects of applications at compile-time
01h 04mHaskell - A Peek Inside the Ivory Tower
20mInteractive Haskell Type Inference Exploration (Extended Abstract)
