Why do you think that? Cross-referencing data can be collected at compile time and made available by the reflection API, which can then be used by any tools that require access to that data. This means that the compiler becomes the single point where the term-expansion hooks are used. This is not theoretical. Logtalk implements reflection and tools this way. Nothing is done twice. Compilation performance is not an issue either as most cross-referencing data is only collected when a source_data
flag is turned on. The term-expansion mechanism design intent was to work at compile time. Having tools calling application expansion hooks at runtime breaks that assumption.