Some alternatives that weren't mentioned:
-
Idea: stateful procedural macros doesn't cover the IO part, but even then it already had major drawbacks;
-
Global Registration (a kind of pre-rfc) for some sort of registration that can be queried at runtime, though it won't work if you have to do additional processing at compile time;
The expanding order could change at any time, I don't think it would be wise to document it. If anything it would be nice to force proc-macros not to depend on it. For example an idea that was floating around in Idea: stateful procedural macros was to have each proc macro produce a payload that would then be reduced at the end with some sort of associative operation.
This also ignores the need for caching the result of deterministic proc-macros, which are the vast majority and IMO should be the default behavior. Note that this has been showed to be highly beneficial for compile times.