~/talk

Unlock the Potential of Swift Code Generation

Talkat try! Swift Tokyo 2025 · 2025-04-09..04-11· [swift, developer-experience]
name:none on file
slides:none on file

Claims that Swift can match Java-style annotation processing by combining Swift macros with a build tool plugin and Swift Syntax tools; shows a concrete DI container (sword) generated at build time and working in a sample app. Explains five implementation steps: declare macros, configure plugin, parse with SwiftSyntax and PathKit, validate with source locations, and render output with SwiftSyntaxBuilder and ArgumentParser. Notes limitation: macros alone cannot emit global cross-module code, but the combined pipeline does and emits compile-time errors with file/line locations.

AI-written summary · about

  1. 0:00Swift code generation intro
  2. 2:59Limitations of Swift macros
  3. 4:04Project structure for DI
  4. 5:49Defining Swift macros
  5. 7:59Configuring build plugins
  6. 11:12Parsing Swift with syntax trees
  7. 15:26Validating macro usage
  8. 17:34Generating code with SwiftSyntax
  9. 20:04Building DA container
  10. 21:08Summary
~/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.