Automate More Code With Scalameta
summary
Live coding shows scalameta as a concrete AST tool: quasiquotes unpacking and repacking of defs, params and modifiers, structural pattern matches on case classes, and manipulation of term/type names. The code generator used in Guardrail writes scala AST trees into sourceManaged so SBT compiles generated files; tests compile and run per PR. Examples include changing parameter lists, visibility, and packaging; the generation workflow proves practical and repeatable.
AI-written summary · about
chapters (9)
- 0:00ScalaMeta introduction
- 2:03Quasi quotes for code gen
- 7:29AST unpacking and repacking
- 13:47Extracting function components
- 23:18Building abstractions from data
- 31:50ScalaMeta as value system
- 35:57Advantages over macros
- 40:02Testing generated code
- 41:49Live coding type class generator








