Adventures In Meta-programming Macros Vs Shapeless
summary
Compares two concrete solutions: a macro that rewrites calls to generate case class instances and a Shapeless-based type-class approach that derives instances via Generic HLists; both implement a Pure type class and handle an iceCream example (String, Int, Boolean). Macros win for small syntactic tasks like extracting a field name into a string, Shapeless wins for structural derivation across fields; shows a working checklist validator, mentions compile-time costs and debugging with cached implicits.
AI-written summary · about
chapters (11)
- 0:00Introduction to metaprogramming
- 1:05Macros vs Shapeless overview
- 2:30Example one constructing values
- 6:45Macro limitations and solutions
- 11:43Shapeless solution for values
- 18:26Macros vs Shapeless comparison
- 20:11Example two validating data
- 21:57Macros for field validation
- 26:09Shapeless for field validation
- 28:42Key takeaways and recommendations
- 30:25Further reading and resources
