i opened RT #61742 because the semantics of the "use" statement in rakudo
changed in such a way that i could no longer precompile mod_perl6 modules.
"use" statements are now being invoked during PAST generation, which
requires any "used" modules to be in the @INC path and error-free. moritz
informed me that this was the correct behavior (which is now obvious to
me), and i was able to fix mod_perl6, but it raised an interesting point.
if a module expects conditions only present at *runtime*, you can never
precompile that module, as the compile-time "use" will fail. this isn't a
problem for regular command-line scripts, but what about code such as a
mod_perl6 handler? the modules it uses assume they're embedded in an
apache process, dlfunc'ing a bunch of apache API functions. right
now it is impossible to compile such a module to bytecode, which i like to
do for startup performance.
i realize that "use" needs to load modules early, but i think there needs
to be a distinction so such modules aren't executed out of context. maybe
there's an obvious way around this, maybe this is a new edge case.