Hacker News new | ask | show | jobs
by ncmncm 1574 days ago
Anybody interested in speeding up the Rust compiler should be looking into generating a new JITted parser after each macro definition, and jumping into it to parse the remaining (and any other affected) code.

The time to compile a new parser ought to be much less than feeding literally all tokens into a runtime macro-definition interpreter.

Similar infrastructure might help with generics type calculus.

1 comments

Rust macros only require special parsing for macro arguments, so most tokens don’t need to touch the macro engine.