~/talk

Adventures in Metaprogramming: Macros versus Shapeless

slides:none on file

Compares concrete implementations: a macro-based macros rewrite code as AST solution that uses Scala reflect to expand a 16–40 line macro, summons a type class Pure to fill constructor params, and extracts field identifiers via pattern-matched trees; versus a shapeless solution that uses LabelledGeneric exposes field names and HLists to derive instances for all case classes. Shows working code (GitHub), reports tradeoffs: macros win for syntactic DSLs and compact expansions, shapeless wins for structural derivation but faces implicit-resolution and compile-time costs.

AI-written summary · about

  1. 0:00Introduction
  2. 1:14What is metaprogramming
  3. 4:47Macros
  4. 8:13Type Classes
  5. 13:23Shapeless Implementation
  6. 17:15Better Code
  7. 20:33Data Validation
  8. 27:06Analysis
  9. 30:32TakeHome Points
  10. 31:56Further Reading
  11. 33:51Questions
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.