Re:Why is my Rust build so slow?
by aliceryhl on Sunday January 02, 2022 @05:05AM
(#29767383)
Well, one of the advantages of having two ways to do macros is that macro_rules! macros are much much faster than procedural macros.
[ Parent
| on HN ]
Yeah, but then why not make it the only one? One reason is that proc-macros can "see" the syntax outside the point of declaration(or enclosed). This means you must do macro_rules! {struct.... } instead of declare the struct first then forward it.