~/talk

A gentle introduction to procedural macros

Talkat EuroRust 2024 · 2024-10-10..10-11· [rust]
slides:none on file

Gentle, practical intro that claims to go from basics to a working derive macro that simplifies (AWS) SQS send/receive; includes live coding that builds a generated client struct with new/send/receive methods and demonstrates it running against localstack and the aws SDK under tokio. Shows parsing via syn and quote inside a separate proc-macro crate, uses format_ident to generate names, and inspects output with cargo expand so the demo actually compiles and works.

AI-written summary · about

  1. 0:00Introduction
  2. 2:35Rust macros and why use them
  3. 5:23Procedural macros in Rust
  4. 7:52Power and use cases
  5. 8:14Live demo setup
  6. 11:23Procedural macro crate
  7. 12:25Basic derive macro function
  8. 13:52Verify macro expansion
  9. 16:01Generating boilerplate
  10. 18:51Limits of hardcoded output
  11. 19:33Inspecting token streams
  12. 20:36Parsing derive inputs
  13. 21:40Analyzing input structure
  14. 22:46Making macro generic
  15. 24:15Testing macro implementation
  16. 24:57When to use macros
  17. 27:02Summary
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.