Metaprogramming + DSL Design in Elixir
summary
Covers Elixir’s actual metaprogramming mechanics: quoted expressions as three‑element tuples, use of var and unquote to cross hygiene boundaries, macros to inject code, and compile-time callbacks like @before_compile and on_definition. Builds a DSL that stores sequences in accumulating module attributes, implements sequence, note and embed macros, generates a module function via before_compile, and delegates runtime playback to a note player that calls ALSA aplay. Live coding runs tests and plays the composed track, all tests pass.
AI-written summary · about
chapters (9)
- 0:0001:02 - Introduction
- 1:0301:46 - Metaprogramming: What is it?
- 1:4702:57 - Metaprogramming: Pros and Cons
- 2:5804:30 - Metaprogramming" When to use it?
- 4:3105:28 - Metaprogramming in Elixir
- 5:2912:54 - Quoted Expressions
- 12:5514:14 - Summary
- 14:1527:17 - Let's build a DSL
- 28:1837:17 - QnA
related talks
35mThe pillars of Metaprogramming in Elixir
52mWrite Less, Do More (and Have Fun!) with Elixir Macros
58mHow I learned to stop worrying and love macros
17mMacros for Domain-Specific Languages
31mRebuilding Espec: Foundations In Metaprogramming,
48mMetaprogramming in Dotty
51mPipe Dreams - Getting More out of Elixir Pipes
46mBuild Your Own Elixir
