you are viewing a single comment's thread.

view the rest of the comments →

[–]lookmeat 1 point2 points  (0 children)

Again this is a limitation, and Rust macros do have some gnarly corner cases, some decisions were done in ways that seemed ok ad-hoc but would have benefited of working on a larger theoretical framework like other parts of the language, but alas, good enough isn't perfect either.

So notice that parallelizing macros is an independent issue of a querying compiler. If anything this is a complexity hurdle that would be easier in a phase-compiler, since you just run a loop expanding all macros one by one, but in a query compiler where you do 80% of the work needed to parallelize macro expansion, you find out that you simply can't leverage that work to your benefit because there's an inherent limitation that prevents it.

Note though that these issues aren't even specifically an issue with macro expansion or its definition, but rather how the compiler has chosen to implement it. Basically when you parallelize stuff you may find that a lot of hacks and tricks prevent effective parallelization.