I’m woefully ignorant about the internals of the macro system, so I don’t know if this is conceptually or practically impossible in the current implementation.
But if it’s not, I’d like to point out that tail-call optimization would go a long way towards making macro_rules!
almost as powerful as procedural macros. The well-known TT munching and stack/queue argument manipulation techniques would especially benefit from it. It would make it possible to parse much more varied DSLs and still be easier to write and arguably more readable than procedural macros (or not.)
In any case, this is currently a serious limitation of the macro system, considering it’s a language without any looping constructs.
What would it mean to add this feature? Is it something a beginner Rust hacker can attempt? Are there any known roadblocks?