JuliaLang / PrecompileTools.jl

Reduce time-to-first-execution of Julia code
MIT License
209 stars 13 forks source link

Improve macro hygeine #8

Closed jakobnissen closed 1 year ago

jakobnissen commented 1 year ago

First, thank you for a great package.

I noticed that the macros exported by PrecompileTools, unlike those of SnoopPrecompile, requires the package to have access to the name PrecompileTools. This means that the following code will fail:

using PrecompileTools: @setup_workload, @compile_workload

@setup_workload let
    ...
    @compile_workload let
        ...
    end
end

It is generally preferred to explicitly import names from packages instead of using a broad using Package statement, since that can cause newly exported names in non-breaking releases to lead to a name being unresolvable, thus breaking code.

So, I propose either: