3 ms·
Rust macros are a mutant foreign language. A much much better system would be one that lets you write vanilla Rust code to manipulate either the token stream o
by forrestthewoods 2y ago
Rust macros are a mutant foreign language.
A much much better system would be one that lets you write vanilla Rust code to manipulate either the token stream or the parsed AST.
- dwattttt 2y ago...? Proc macros _are_ vanilla Rust code written to manipulate a token stream.
- forrestthewoods 2y agoYou’re right. I should have said I want vanilla Rust code for vanilla macros and I want to manipulate the AST not token streams. Token manipulation code is frequently full of syn! macro hell. So even token manipulation is only kind of normal Rust code.