Herding types with Scala macros
summary
Shows a small Scala library that uses compile-time reflection and Scala macros to generate per-type serializers and deserializers for a schemaless key‑value store (Aerospike style), eliminating the dozens of boilerplate reader/writer methods for keys and bins. Macros materialize macro materialized writers and readers at compile time, emit code that handles strings, numbers, maps and collections, allow explicit serializer selection, come with tests for many type mappings, and are used successfully in production.
AI-written summary · about
chapters (9)
- 0:00Introduction
- 1:08Problem and Goals
- 2:41Aerospike Data Structure
- 4:08Bridging Data Types
- 6:18Building the Interface
- 7:56Implementation Details
- 10:05Using Scala Macros
- 12:29Code Generation and Tests
- 14:55Q&A and Conclusion








