~/talk

Metaprogramming in Dotty

links:none on file
slides:none on file

Scala 3 replaces Scala 2 macros with a redesigned, portable system that uses the tasty file format and two user-facing mechanisms: quotes and splices for generating typed code fragments and inline/match-types for compile-time specialization. Examples: a staged power function that unfolds when exponent is constant, tuple concat/size computed as types, and constValue to lift literal types into terms. A low-level API, tasty reflect, exposes tree inspection/construction for deeper macros; parts already power library optimizations and IDE tooling, with quotes landing around 3.1 and reflect stabilizing later.

AI-written summary · about

  1. 0:00Start
  2. 2:38Syntax
  3. 3:14Macros
  4. 4:48By Name and by Value
  5. 9:55Pattern Matching with a Match
  6. 11:52Class Hierarchy
  7. 14:24Type Matches
  8. 15:46Topple Obstruction
  9. 21:33Quotes and Splices
  10. 27:54White Box Macros
  11. 34:56Pattern Match on Different Internal Trees
  12. 39:18How Do You Raise Custom Compilation Errors from Inline Methods and Macro
  13. 44:54Rule of Thumbs as to When You Should Use Inline and When You Should Use Macros
~/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.