Macros
You've been using macros since your very first Rust program — `println!` is one, and so are `vec!`, `assert_eq!`, and `#[derive(...)]`. That telltale exclamation mark, and those `#[...]` attributes, mark code that isn't a normal function call but metaprogramming: code that writes code at compile time. Macros are how Rust does the powerful, boilerplate-eliminating tricks that would need runtime reflection or code generators in other languages — all checked at compile time. This closing post of the series demystifies them.
You've been using macros since your first Rust program — println! is one, and so are vec!, assert_eq!, and #[derive(...)]. That exclamation mark marks metaprogramming: code that writes code at compile time. This closing post of the series demystifies Rust's powerful, boilerplate-eliminating macro system.