Stretching the Glasgow Haskell Compiler: Nourishing GHC with Domain-Driven De...
summary
Analysis of the Glasgow Haskell Compiler finds concrete anti-patterns: shotgun parsing — ad hoc runtime predicates (about 56 occurrences counted) that proliferate checks and hide bugs — and layering leaks where DynamicFlags acts like a global mutable record that spreads coupling. The proposal extracts a four‑layer architecture (presentation, application/driver, domain, infrastructure), breaks large records into explicit components, and introduces small CMM config records (9 fields vs 191) plus handshake functions; these changes enable unit tests that were previously impractical and reduce silent bug introduction.
AI-written summary · about
chapters (28)
- 0:00Introduction
- 1:26Talk overview
- 2:09Key takeaways
- 3:34Project goals and GHC
- 4:20Caveats and scope
- 6:26System components and domains
- 7:33Shotgun parsing in GHC
- 13:41Why shotgun parsing breaks modularity
- 15:08Layering violations in GHC
- 16:58Consequences of layering violations
- 17:42Domain-driven design philosophy
- 18:46Hard-to-change systems
- 19:29Brand books and system guidance
- 20:54Package naming in GHC
- 23:53Recommendations for domain-driven design
- 24:59Four-layer architecture for GHC
- 26:46Module hierarchy and communication
- 27:49Supple design and componentization
- 29:58Explicit layering in hierarchy
- 30:23Componentization and global state
- 33:17Component-wise configuration in GHC
- 36:18Isolating components with configs
- 37:21References and concluding remarks
- 38:56Q&A
- 39:58Cross-cutting concerns in compiler
- 42:09Organizing large domain layers
- 44:18Design goals and trade-offs
- 48:15Final comments
related talks
36mWorking Hard to Keep Things Lazy
24mCatching space leaks at compile-time using th-deepstrict
52mFunctional Patterns for the Object Oriented
59mHaskell Design Patterns for Genericity & Asynchronous Behavior
57mReal-world Haskell: Good, Bad, & Ugly
02h 38mLazy Evaluation
38mWhat Haskell Taught Us When We Weren't Looking
53mIntro to Haskell for Erlangers
