Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update internal terminology: Substs -> GenericArgs #110793

Open
Tracked by #110254
lcnr opened this issue Apr 25, 2023 · 19 comments · Fixed by #113591
Open
Tracked by #110254

update internal terminology: Substs -> GenericArgs #110793

lcnr opened this issue Apr 25, 2023 · 19 comments · Fixed by #113591
Assignees
Labels
C-cleanup Category: PRs that clean code up or issues documenting cleanup. E-medium Call for participation: Medium difficulty. Experience needed to fix: Intermediate. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.

Comments

@lcnr
Copy link
Contributor

lcnr commented Apr 25, 2023

change substitutions to the more familiar name of generic arguments in the compiler.

this work was started in #113591 but there are still some uses of the old terminology left.

How to work on this

grep for remaining uses of subst, substitution and substitute and figure out how to replace them with the new terminology: instantiate and generic argument

cc #110254 @oli-obk

@lcnr lcnr changed the title Substs -> GenericArgs update internal terminology: Substs -> GenericArgs Apr 25, 2023
@lcnr lcnr added E-medium Call for participation: Medium difficulty. Experience needed to fix: Intermediate. C-cleanup Category: PRs that clean code up or issues documenting cleanup. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. labels Apr 25, 2023
@lcnr
Copy link
Contributor Author

lcnr commented Apr 25, 2023

This does require some familiarity with the compiler as I assume it to be very annoying to rebase in case there are issues with the implementation.

@ghost
Copy link

ghost commented May 31, 2023

@lcnr can i work on this?

@ghost
Copy link

ghost commented May 31, 2023

@rustbot claim

@rustbot rustbot assigned ghost May 31, 2023
@mdibaiee
Copy link
Contributor

@AnakinSkywalkeer are you still working on this? If not I would like to work on this.

@ghost ghost removed their assignment Jul 11, 2023
@ghost
Copy link

ghost commented Jul 11, 2023

@AnakinSkywalkeer are you still working on this? If not I would like to work on this.

sure

@mdibaiee
Copy link
Contributor

@rustbot claim

@lcnr
Copy link
Contributor Author

lcnr commented Sep 25, 2023

there are still quite a few uses of subst, substitution and substitute left, so I am keeping this open for now

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Sep 26, 2023
subst -> instantiate

continues rust-lang#110793, there are still quite a few uses of `subst` and `substitute`, but changing them all in the same PR was a bit too much, so I've stopped here for now.
bors added a commit to rust-lang-ci/rust that referenced this issue Sep 26, 2023
subst -> instantiate

continues rust-lang#110793, there are still quite a few uses of `subst` and `substitute`, but changing them all in the same PR was a bit too much, so I've stopped here for now.
flip1995 pushed a commit to flip1995/rust that referenced this issue Oct 6, 2023
subst -> instantiate

continues rust-lang#110793, there are still quite a few uses of `subst` and `substitute`, but changing them all in the same PR was a bit too much, so I've stopped here for now.
@DavidCoy77
Copy link

there are still quite a few uses of subst, substitution and substitute left, so I am keeping this open for now

I'm interested in contributing, but I'm new to Rust and GitHub. I've noticed this issue is marked "E-mentor", so if you'd be willing to offer guidance I'd love to help!

Thanks,
David

@ShoyuVanilla
Copy link
Member

@rustbot claim

@RalfJung
Copy link
Member

RalfJung commented Feb 12, 2024

I realize it's too late to ask for this now, but... was there ever an MCP for this?
I personally find "substitute" a lot more clear than "instantiate". "instantiate" works when a generic function is instantiated, but once we are inside a generic function, we have a whole bunch of terms and types that reference generic parameters. I seems strange to say that we "instantiate" these terms, I never encountered this use of the term "instantiate" before -- what we do is we substitute the generic parameters for their concrete values.

Not all jargon is bad. Subtle technical concepts need precise terms to describe them.

@lcnr
Copy link
Contributor Author

lcnr commented Feb 12, 2024

I realize it's too late to ask for this now, but... was there ever an MCP for this?

yes-ish

rust-lang/compiler-team#451 which was discussed in https://rust-lang.zulipchat.com/#narrow/stream/233931-xxx/topic/Rename.20various.20internal.20things.20compiler-team.23451

after quite a while @oli-obk then opened #110254 which was discussed in https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/naming.20bikeshedding

I think the situation is unfortunate and looking back it would have likely been better to open separate MCPs for each individual change. Because the original second was a "I agree with most of these changes, idc about the others" and then we never really got official confirmation for any of them, so any actual name changes have been somewhat vibe based :/

@RalfJung
Copy link
Member

That MCP suggested subst → replace_generics, which sounds better to me than "instantiate". I guess it was avoided because it was too long?

@lcnr
Copy link
Contributor Author

lcnr commented Feb 12, 2024

@RalfJung
Copy link
Member

🤷 maybe I'm in the minority here. I teach substitution in class so I'm obviously biased towards finding this a completely natural term to begin with, so I have a fairly high bar for what I consider a good replacement.

@ShoyuVanilla
Copy link
Member

Hmm, would it be better to change it into other suitable name? Maybe I just opened PR without sufficient considerations.
TBH I myself prefer more academic terms in codes like substitutions or skolemizations(unrelated here but IIRC it is also renamed in rustc some time ago).
The reason I worked on this is, while reading rust compiler dev guide book to learn about rustc, I saw some naming mismatches between the book and rustc, and thought that this would be a good first issue to work on 😅

@RalfJung
Copy link
Member

I'm happy the skolemization term is gone as I was never convinced that this was actually skolemization in the sense it is used in e.g. logic. ;)

@ShoyuVanilla
Copy link
Member

I'm happy the skolemization term is gone as I was never convinced that this was actually skolemization in the sense it is used in e.g. logic. ;)

Didn't know that cause I was not using rust that day 😄

@camsteffen
Copy link
Contributor

camsteffen commented Feb 12, 2024

As a compiler amateur, I also find "substitute" to be more intuitive than "instantiate". My understanding is (correct me if I'm wrong): you take a type representation with generic values and you substitute those generic values with concrete types to produce another type representation. I think the word was helpful for me to build that mental model when digging into rustc.

@RalfJung
Copy link
Member

Yes that understanding sounds right.

Also worth mentioning, we have a type called Instance in rustc that shows up quite a bit. However, the new usage of "instantiate" is unrelated to that -- we're now instantiating types and MIR statements and whatnot, without there being an Instance in these cases. "Instance" refers to the specific case of instantiating a generic function, not an arbitrary generic thing.

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Feb 12, 2024
Dejargonize `subst`

In favor of rust-lang#110793, replace almost every occurence of `subst` and `substitution` from rustc codes, but they still remains in subtrees under `src/tools/` like clippy and test codes (I'd like to replace them after this)
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Feb 12, 2024
Dejargonize `subst`

In favor of rust-lang#110793, replace almost every occurence of `subst` and `substitution` from rustc codes, but they still remains in subtrees under `src/tools/` like clippy and test codes (I'd like to replace them after this)
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Feb 13, 2024
Rollup merge of rust-lang#120958 - ShoyuVanilla:remove-subst, r=oli-obk

Dejargonize `subst`

In favor of rust-lang#110793, replace almost every occurence of `subst` and `substitution` from rustc codes, but they still remains in subtrees under `src/tools/` like clippy and test codes (I'd like to replace them after this)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-cleanup Category: PRs that clean code up or issues documenting cleanup. E-medium Call for participation: Medium difficulty. Experience needed to fix: Intermediate. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants