dtolnay/proc-macro-workshop

Learn to write Rust procedural macros  [Rust Latam conference, Montevideo Uruguay, March 2019]

View on GitHub ↗Jump to charts ↓

Summary Information

Updated 44 minutes ago
Added to GitGenius on September 14th, 2026
Created on March 27th, 2019
Open Issues & Pull Requests: 3 (+0)
GitHub issues: Enabled
Number of forks: 1,218
Total Stargazers: 4,864 (+0)
Total Subscribers: 40 (+0)

Repository Insights (GitGenius)

Median issue/PR response: 8.7 hours
Mean response time: 31.2 days
90th percentile: 62.0 days
Tracked items: 2

Most active contributors

Sign in to see contributor activity.

Charts & Analytics

Fetching additional details & charts...

Issue Activity (beta)

Open issues: 1
New in 7 days: 0
Closed in 7 days: 0
Avg open age: 60 days
Stale 30+ days: 1
Stale 90+ days: 0

Recent activity

Opened in 7 days: 0
Closed in 7 days: 0
Comments in 7 days: 0
Events in 7 days: 0

Top labels

No label distribution available yet.

Most active issues this week

No issue events were indexed in the last 7 days.

Detailed Description

proc-macro-workshop is an educational resource for learning to write Rust procedural macros.

The workshop addresses the challenge of understanding how to generate Rust code programmatically through macros. It teaches this through five hands-on projects that progress from foundational concepts to more complex implementations. Each project is grounded in real-world use cases: three are macros the author has implemented in production codebases, and two are existing libraries published on crates.io. The projects cover derive macros, function-like macros, and attribute macros, teaching developers how to traverse syntax trees, construct output source code, and process helper attributes.

The workshop suits developers who already understand Rust fundamentals like structs, enums, traits, trait implementations, generic parameters, and trait bounds. The five projects are the `derive(Builder)` macro for implementing the builder pattern, the `derive(CustomDebug)` macro for customizable Debug trait implementations, the `seq!` function-like macro, the `#[sorted]` attribute macro, and the `#[bitfield]` attribute macro. Each project goes into depth beyond its introduction and includes a test harness for validation. The workshop provides project recommendations based on developer interests and includes debugging tips to support the learning process.

The project maintains a structured approach with clear prerequisites, a recommended workflow, and organized project directories. The material assumes learners will work through the projects sequentially or select based on their specific interests in macro types. The workshop includes explanations of testing setup and provides guidance on how to approach each exercise effectively.