Herding types with Scala macros
summary
Macros generate compile‑time materialized wrappers that map Scala types to Aerospike's limited runtime types, replacing the Java client churn (about 7 key and 12 bin variants and ~30 get methods) with concise put/get APIs. The implementation uses Scala macros and quasiquotes to inspect types, emit key and bin converters for strings, case classes and HLists (stored as HList as native map), and catch many mismatches at compile time; a tradeoff is extra classes per materialization that can affect class loading.
AI-written summary · about
chapters (12)
- 0:00Introduction
- 2:00Roadmap
- 5:53Storage
- 8:08Get function
- 10:51Implementation
- 12:09Key
- 15:19Wrapper
- 16:53Bin Browser
- 19:30Choice
- 21:41Cleanup
- 22:49Questions
- 24:00Why use macros
related talks
49mIdris for (im)practical Scala programmers
42mLet the Compiler Help You: How to Make the Most of Scala's Type System
48mA gentle introduction to type level programming in Scala
44mType level Computations in Scala
26mMigrating Gallia to Scala 3 the good, the bad and the very good
36mHow to Write Resilient Swift code (and do it faster with Macros)
30mConstraint Typing with Boolean Algebra
38mScalaJS and Typescript: an unlikely romance
