~/talk

Implementing a Macro

links:none on file
slides:none on file

A working string-interpolator macro and companion extractor for a tiny JSON DSL that compiles the literal parts plus the inline arguments into a runtime JSON value and into a schema used to produce refinement types for object fields and array element types. Implementation uses inline methods, quotes/splices, Selectable/selectDynamic, transparent macros and reflection to inspect argument types; it emits errors with precise source offsets mapped into the original string part. Code and slides live on GitHub.

AI-written summary · about

  1. 0:00Macro implementation intro
  2. 1:10JSON DSL design
  3. 3:37Scala Selectable access
  4. 4:20String interpolator basics
  5. 7:32Macro implementation details
  6. 9:18String context parsing
  7. 13:33JSON extractor
  8. 15:19Metaprogramming patterns
  9. 19:13Refining types with macros
  10. 22:50Transparent macros types
  11. 24:40Schema generation
  12. 31:28Error reporting in macros
  13. 35:07Q&A
~/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.