Slow-Auto, Inconvenient-Semi: escaping false dichotomy with sanely-automatic derivation
summary
Shows a concrete replacement for “automatic vs semi‑automatic”: a sanely-automatic derivation that derives recursively, caches intermediate defs, and still lets user‑provided implicits override defaults. Implements it as a macro in Chimney and a jsoniter wrapper; a 5‑level nested case class triggers ~40s compile with naive automatic vs ~10s with semi‑auto on Scala 3, while jsoniter‑style derivation is 2–3x faster at runtime and avoids the compilation explosions. Error messages and debuggability improve.
AI-written summary · about
chapters (12)
- 0:00Slow-Auto and derivation intro
- 3:35Type classes in Scala
- 7:11Automatic vs semi-automatic
- 14:03Why semi-automatic matters
- 18:18Derivation performance impact
- 21:29Error messages across libraries
- 26:42JSON and recursive derivation
- 31:55Recursive derivation patterns
- 34:00Cats Show comparison
- 37:12Macro optimizations and errors
- 40:25Scala 3 benchmarks
- 41:27Summary and call to action
related talks
42mAvoiding macros with inline and derived
29mADVENTURES IN META-PROGRAMMING
26mMaking life easier with Derive and other tools
25mAuto code generation using AI & Scala Macros
01h 12mDeriving pleasure
40mMacros vs Types
43mAdventures in Metaprogramming: Macros versus Shapeless
28mAutomating API Busywork with Scala
