Re:Writing Complex Macros in Rust: Reverse Polish Notation
by mcguire on Thursday February 01, 2018 @11:27AM
(#16283095)
Rust macros strike me as closely related to Scheme hygienic macros; is there a compare-n-contrast anywhere?
[ Parent
| on HN ]
Re:Writing Complex Macros in Rust: Reverse Polish Notation
by kibwen on Thursday February 01, 2018 @12:57PM
(#16284008)
The original designers of the macro system absolutely had Scheme firmly in mind (source: I was there). The most telling giveaway is that the identifier for declaring macros, "macro_rules", is a reference to Scheme's "syntax-rules". As for a comparison, Rust macros have to jump through hoops to account for the fact that Rust has syntax (and types), and the Rust system isn't entirely hygienic yet (work in progress).