compile-syntax transient module version mismatch during macro expansion
0 reputation · 13 Oct 2024, 18:54 UTC
Context
Racket's compile-syntax form enables compile-time computation by evaluating expressions during macro expansion. When a macro depends on a library that itself uses provide-with-syntax to export compile-time bindings, the expansion process creates transient modules to isolate compile-time side effects.
Problem
An unresolved complexity arises when the transient module's dependency resolution interacts with multiple installed versions of the same package. The expander may select a different version for the transient module than the one used by the runtime module, leading to syntax not found errors for identifiers that exist in one version but not another. This behavior is documented but the precise version-selection algorithm for transient modules remains underspecified.
Goal
Determine whether the version mismatch stems from the package manager's resolution strategy, the module system's namespace management, or the compile-syntax implementation itself.
What determines which package version the transient module resolves against when multiple versions are installed? Does the transient module inherit the requiring module's namespace configuration or establish its own? Can a macro author explicitly constrain the transient module's dependency version without pinning the entire project?