Skip to content

Split reflection into compiler-dependent and compiler-independent pieces#56185

Merged
Keno merged 1 commit intomasterfrom
kf/splitreflection
Oct 17, 2024
Merged

Split reflection into compiler-dependent and compiler-independent pieces#56185
Keno merged 1 commit intomasterfrom
kf/splitreflection

Conversation

@Keno
Copy link
Copy Markdown
Member

@Keno Keno commented Oct 16, 2024

The reflection.jl file provides a large amount of functionality covering everything from helpers for access to core runtime data structures to setting up particular inference problems. It is included by both Base and Core.Compiler, but the functions that use the compiler, don't really make sense in the latter. In preparation for #56128, and stop including the compiler-dependent pieces in Core.Compiler.

While we're here, also move a few generically useful reflection functions out of Core.Compiler, so users that access
them don't have to load the compiler.

Split out from #56128, but doesn't make any semantic changes by itself, so should be quick/easy to merge.

!!! compat "Julia 1.10"
The additional syntax is supported as of Julia 1.10.
"""
macro invoke(ex)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@invoke and @invokelatest should probably live in base/reflection.jl?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently calls into Compiler for spurious reasons. Could be changed, but let's do that in a separate commit.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok👌

base/Base.jl Outdated
include("gcutils.jl")
include("generator.jl")
include("reflection.jl")
include("reflection2.jl")
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aviatesk proposed renaming to compiler_reflection.jl, which seems reasonable to me.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps we should instead rename reflection.jl to internals.jl. I think that would be a better description of what it actually does: Provide accessors to various internal julia data structures.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

internals.jl sounds reasonable to me.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will rename accordingly.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something compiler_internals.jl would be better imo.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not compiler internals though, it's internals of like method tables and other runtime datastructures.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, this is more runtime_internals.jl or cache_internals.jl ?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, my point was mostly xxx_internals.jl.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm ok with runtime_internals.jl

@Keno Keno force-pushed the kf/splitreflection branch 2 times, most recently from 40d3835 to 98a4af0 Compare October 16, 2024 11:16
The `reflection.jl` file provides a large amount of functionality covering
everything from helpers for access to core runtime data structures to setting
up particular inference problems. It is included by both Base and Core.Compiler,
but the functions that use the compiler, don't really make sense in the latter.
In preparation for #56128, and stop including the compiler-dependent pieces in
Core.Compiler.
@Keno Keno force-pushed the kf/splitreflection branch from 98a4af0 to 9d6fb2b Compare October 16, 2024 14:10
@Keno Keno merged commit 222cde9 into master Oct 17, 2024
@Keno Keno deleted the kf/splitreflection branch October 17, 2024 05:19
KristofferC pushed a commit that referenced this pull request Oct 21, 2024
…ces (#56185)

The `reflection.jl` file provides a large amount of functionality
covering everything from helpers for access to core runtime data
structures to setting up particular inference problems. It is included
by both Base and Core.Compiler, but the functions that use the compiler,
don't really make sense in the latter. In preparation for #56128, and
stop including the compiler-dependent pieces in Core.Compiler.

While we're here, also move a few generically useful reflection
functions out of Core.Compiler, so users that access
them don't have to load the compiler.

Split out from #56128, but doesn't make any semantic changes by itself,
so should be quick/easy to merge.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants