Making life easier with Derive and other tools
summary
Uses derive macros (syn, quote, synstructure, darling) to generate hundreds of repetitive implementations across 362 CSS properties, replacing hand‑written match/serialize/compute code and removed 4,000 LOC from Servo. Builds a procedural macro that emits serialization and has‑viewport‑percentage logic per enum/field, finds real bugs (missing spaces in serialization), and implements an inert crate that auto‑generates neutralized wrappers so single‑threaded RefCell data can be accessed from layout threads without ad‑hoc unsafe code.
AI-written summary · about
chapters (7)
- 0:00Introduction to Stylo
- 5:29Procedural macros
- 7:27Implementing derive macros
- 10:46Handling complex serialization
- 13:49Using Darling for attributes
- 16:09The Inert crate and concurrency
- 23:51Q&A and closing remarks
related talks
28mRe:Zero - writing a custom derive
24mProcedural Macros 101
28mA gentle introduction to procedural macros
24mMacros for a More Productive Rust
29mMacromancy: an introduction to Rust macros
48mRefactoring from Good to Great - A Live-Coding Odyssey
26mMy Little Procedural Macro
29mProcedural Macros vs Sliced Bread
