Design by Introspection
summary
Design by Introspection claims a small set of rules — rule of optionality, rule of introspection, rule of elastic composition — and shows concrete tooling to make them work: compile-time traits and reflection, static if and compile-time function evaluation, and string mixin code generation. Replacing top-level imports with scoped imports speeds D stdlib builds by about an order of magnitude on a 200k‑line library; a production datastore uses static if roughly every ten statements. Examples include optional-interface APIs and compact checked‑integer implementations that compile to efficient code.
AI-written summary · about
chapters (11)
- 0:00Introduction to D language
- 1:58Performance and scale
- 4:59Design principles
- 7:13Scoped imports
- 12:04Granular dependencies
- 17:04Compiler and linker trade-offs
- 21:49Static if and flexibility
- 26:01Compile time evaluation
- 31:00Policy based design
- 37:01Design by introspection
- 40:04Practical applications
related talks
01h 08mReflections: Compile-time Introspection of Source Code
46mWhat FP Can Learn From Static Introspection
56mExploring Dependency Injection and Reflection in Modern C++
01h 01mReflection
22mDSLs in Racket: You Want It How, Now?
47mReflection Techniques in C++
36mCompile-time reflection, Serialization and ORM
58mPanel discussion: Types for All: From weak to strong, from static to dynamic
