release Compiler v1.12.0 (and discussion on how to use it) #57520
+2
−2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
For external packages like Cthulhu that use the Compiler.jl stdlib, it's quite a hassle to manage all three types of compatibility: between the external package, the Julia runtime, and Compiler.jl.
I'm thinking instead of handling these compatibility issues by some complex version engineering for Compiler.jl, we should keep its use supplementary. External
AbstractInterpreter
packages should primarily useBase.Compiler
, while managing compatibility with the Julia runtime andBase.Compiler
. This would bring us back to the previous situation, but it seems better in terms of compatibility management.On the other hand, using the Compiler.jl stdlib allows for easy switching of the
Compiler
implementation, which should be an optional benefit. This is especially useful when developing theCompiler
itself, where it's common to dopkg> dev /path/to/Compiler
. In such cases, the implementation of the Compiler.jl stdlib should be used instead ofBase.Compiler
.As a mechanism to switch the
Compiler
implementation used by externalAbstractInterpreter
packages, using package extensions might be the simplest approach. As shown inthis example PR, we can switch the
Compiler
implementation whenusing Compiler
is called1, and still precompile the usual code. However, to list Compiler.jl in[extensions]
, it needs a version. To this end, I propose releasing Compiler.jl versions in line with the Julia runtime versions, following other Julia standard libraries. But we would only do minor version releases, not patch releases, which are harder to define. Specifically, we could release a corresponding version of Compiler.jl when a release branch is cut. After that, we wouldn't manage patch versions, and as long aspkg> dev /path/to/Compiler
works, this simple versioning should suffice.Alternatively, we could register a single version
1.0.0
of Compiler.jl with a dummy implementation, letting the external package determine if the implementation is real (developed) or dummy, but this seems more hacky than using package extensions.Footnotes
Also, I'm aware of another issue: when using the Compiler.jl
stdlib, you need to run
InteractiveUtils.@activate Compiler
first,or else some reflection utilities won't work (for example,
Base._which(tt; method_table=Compiler.method_table(myinterp))
).I think this problem can be solved by adding
InteractiveUtils.@activate
in the__init__
function of the packageextension code, but I'm not sure if this is a safe solution. It might
be better to set up a callback that only gets called when
InteractiveUtils.@activate
is executed? ↩