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.
Matching moments
25:32 MIN
Q&A on ecosystem integration and custom metadata
Reasoning about Rust: an introduction to Rustdoc's JSON format
29:34 MIN
The future of Rust in modern web development
Get ready to Rustle
24:07 MIN
Implementing observability with metrics and distributed tracing
Rust Beyond Systems: Revolutionizing Web Development
03:32 MIN
Building an AI-powered app with Rust and Docker
Coffee with Developers - Francesco Ciulla
23:52 MIN
Practical strategies for adopting Rust in your projects
Get ready to Rustle
08:09 MIN
A strategic approach to teaching Rust on YouTube
Coffee with Developers - Francesco Ciulla
07:35 MIN
The limitations of macros for static analysis
Reasoning about Rust: an introduction to Rustdoc's JSON format
01:50 MIN
Understanding why frameworks were created for human teams
Are frameworks like React redundant in an AI world?
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
Rust Beyond Systems: Revolutionizing Web Development
Patrick Koss
Microfrontends with Blazor: Welcome to the Party!
Florian Rappl
Get ready to Rustle
Marco Otte-Witte
Building for the Edge - Crafting a Next-Gen Framework
Daniel Roe
From learning to earning
Jobs that call for the skills explored in this talk.








