Welcome to Macros in Rust
Welcome to the course on Macros in Rust. Macros are a powerful tool for meta-programming, allowing to abbreviate and generate code without runtime overhead.
In this course, we will cover:
- What macros are and why they are useful.
- The distinction between declarative and procedural macros.
- How the compiler processes tokens and constructs syntax trees.
- How to define Macros By Example and how they are matched, and expanded.
- Advanced declarative macro techniques.
- Macro hygiene and scoping.
- How to write procedural macros, along with typical structure and patterns.
Schedule
Including 10 minute breaks, this session should take about 6 hours and 5 minutes. It contains:
| Segment | Duration |
|---|---|
| What Is A Macro | 30 minutes |
| Macros In Rust | 30 minutes |
| Macros, Tokens, and Syntax | 15 minutes |
| Macros By Example | 1 hour |
| Declarative Macro Techniques | 1 hour |
| Hygiene | 15 minutes |
| Procedural Macros | 1 hour and 35 minutes |