Macros for a More Productive Rust
summary
Shows concrete macro techniques: reproduces an as_bytes trait impl for every integer type with a single macro, demonstrates recursive token‑tree parsing and repetition patterns, and uses internal rules plus a tt‑mantra to process tokens one at a time. Mentions tooling like cargo expand and the Rust playground, the paste crate to synthesize identifiers, syn/quote for proc macros, examples like serde/derive, binread, inline_python, skyline_hook (binary function patching), and cpp_inherit (DWARF/vtable generation via GCC).
AI-written summary · about
chapters (6)
related talks
29mMacromancy: an introduction to Rust macros
39mRust metaprogramming - macro_rules! beyond basics
18mImpractical Macros
25mPowerful Macros, Good IDE Support, No Headaches. Choose Two
27mParsing Rust code considered harmful
25m"Eternal Sunshine of the Rustfmt'ed Mind"
01h 22mRust for the C++ Programmer
28mA gentle introduction to procedural macros
