This refactors `Type` to be a proper kind (like Union) rather than a
magic DataType. In addition, the (also, but separately) magic Type{T}
(T free) supertype of `DataType` is replaced by a proper abstact type.
The previous design dates back to before DataType and UnionAll were
separate concepts and were essentially a hack to make `Type` behave
properly. Such hacks are no longer required. This PR is primarily
prepratory to address several long-standing soundness issues around
the subtyping of Type, but this PR itself does not address those
issues yet - it is intended to be purely the structural change that
will enable those changes in a follow on PR.
The new kind is called TypeEq, but `const Type = TypeEq{T} where T`
is retained, so users keep using `Type{}` as usual. The new supertype
of DataType is called `Kind` and `Type == Kind` (but not === of course).
`getproperty` overloads are provided for compatibility, but the
recommended accessor for new code is a (new) `Base.type_parameter`.
Written by GPT 5.5
The Compiler module
This directory maintains the implementation of the Julia compiler.
Through a bootstrapping process, it is bundled into the Julia runtime as Base.Compiler.
You can also use this Compiler module as the Compiler standard library by following the steps below.
How to use
To utilize this Compiler.jl standard library, you need to declare it as a dependency in
your Project.toml as follows:
Project.toml
[deps]
Compiler = "807dbc54-b67e-4c79-8afb-eafe4df6f2e1"
[compat]
Compiler = "0.1"
With the setup above, the special placeholder version (v0.1) will be installed by default.1
If needed, you can switch to a custom implementation of the Compiler module by running
pkg> dev /path/to/Compiler.jl # to use a local implementation
or
pkg> add https://url/of/Compiler/branch # to use a remote implementation
This feature is particularly useful for developing or experimenting with alternative compiler implementations.
Note
The Compiler.jl standard library is available starting from Julia v1.10. However, switching to a custom compiler implementation is supported only from Julia v1.12 onwards.
Warning
When using a custom, non-
Baseversion ofCompilerimplementation, it may be necessary to runInteractiveUtils.@activate Compilerto ensure proper functionality of certain reflection utilities.