Mykhailo Maidan
Crafting Custom Frameworks with Rust: A Deep Dive into Procedural Macros
#1about 7 minutes
Exploring the power and pitfalls of Rust macros
Rust's metaprogramming capabilities allow for reducing boilerplate code, but macros can be complex to write, debug, and test.
#2about 6 minutes
Simplifying event handlers with custom attribute macros
An event-driven framework's API can be significantly simplified by using attribute macros to define event handlers and their corresponding events.
#3about 7 minutes
Overcoming unordered macro expansion with build-time metadata
To solve the problem of unordered macro expansion, a build script (`build.rs`) can analyze the source code and generate a metadata file before compilation.
#4about 8 minutes
Parsing crate source code with the `syn` crate
The `syn` and `syn-inline-mod` crates enable parsing an entire Rust crate into a single Abstract Syntax Tree (AST), which can then be analyzed using the visitor pattern.
#5about 5 minutes
Loading metadata and modifying the AST in macros
Procedural macros can load the pre-generated metadata from disk and use the `VisitMut` trait from `syn` to modify the AST, such as renaming functions to simulate overloading.
#6about 8 minutes
Evaluating the trade-offs of a metadata-driven macro framework
While this metadata-driven approach offers powerful compile-time checks and extensibility for tooling, it increases build times and implementation complexity.
#7about 12 minutes
Q&A on testing, nightly Rust, and framework design
The discussion covers practical considerations like the necessity of nightly Rust for certain features, strategies for testing complex macros, and potential runtime optimizations.
Related jobs
Jobs that call for the skills explored in this talk.
Dennemeyer Group
Hesperange, Luxembourg
Intermediate
Senior
.NET
Structured Query Language (SQL)
Matching moments
01:32 MIN
Organizing a developer conference for 15,000 attendees
Cat Herding with Lions and Tigers - Christian Heilmann
04:49 MIN
Using content channels to build an event community
Cat Herding with Lions and Tigers - Christian Heilmann
04:57 MIN
Increasing the value of talk recordings post-event
Cat Herding with Lions and Tigers - Christian Heilmann
03:17 MIN
Selecting strategic partners and essential event tools
Cat Herding with Lions and Tigers - Christian Heilmann
02:39 MIN
Establishing a single source of truth for all data
Cat Herding with Lions and Tigers - Christian Heilmann
02:54 MIN
Automating video post-production with local scripts
Cat Herding with Lions and Tigers - Christian Heilmann
02:44 MIN
Rapid-fire thoughts on the future of work
What 2025 Taught Us: A Year-End Special with Hung Lee
03:48 MIN
Automating formal processes risks losing informal human value
What 2025 Taught Us: A Year-End Special with Hung Lee
Featured Partners
Related Videos
Reasoning about Rust: an introduction to Rustdoc's JSON format
Luca Palmieri
A Love Letter to Rust
Rainer Stropek
Eternal Sunshine of the Spotless Programming Language
Stefan Baumgartner
Interface Contracts in Microfrontend Architectures
Alexander Günsche
Microfrontends with Blazor: Welcome to the Party!
Florian Rappl
Rust Beyond Systems: Revolutionizing Web Development
Patrick Koss
Get ready to Rustle
Marco Otte-Witte
Building for the Edge - Crafting a Next-Gen Framework
Daniel Roe
Related Articles
View all articles



From learning to earning
Jobs that call for the skills explored in this talk.








