Skip to content

update internal terminology: Substs -> GenericArgs #110793

Description

@lcnr

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

Activity

  1. changed the title [-]`Substs` -> `GenericArgs`[/-] [+]update internal terminology: `Substs` -> `GenericArgs`[/+] on Apr 25, 2023
  2. added
    E-mediumCall for participation: Medium difficulty. Experience needed to fix: Intermediate.
    C-cleanupCategory: PRs that clean code up or issues documenting cleanup.
    E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.
    on Apr 25, 2023
  3. lcnr commented on Apr 25, 2023

    @lcnr
    ContributorAuthor

    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.

  4. mdibaiee commented on Jul 11, 2023

    @mdibaiee
    Contributor

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

  5. Repository owner unassigned on Jul 11, 2023
  6. mdibaiee commented on Jul 11, 2023

    @mdibaiee
    Contributor

    @rustbot claim

  7. added a commit that references this issue on Jul 14, 2023
    5767cad
  8. 7 remaining items

  9. ShoyuVanilla commented on Jan 23, 2024

    @ShoyuVanilla
    Member

    @rustbot claim

  10. RalfJung commented on Feb 12, 2024

    @RalfJung
    Member

    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.

  11. lcnr commented on Feb 12, 2024

    @lcnr
    ContributorAuthor

    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 :/

  12. RalfJung commented on Feb 12, 2024

    @RalfJung
    Member

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

  13. RalfJung commented on Feb 12, 2024

    @RalfJung
    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.

  14. ShoyuVanilla commented on Feb 12, 2024

    @ShoyuVanilla
    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 😅

  15. RalfJung commented on Feb 12, 2024

    @RalfJung
    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. ;)

  16. ShoyuVanilla commented on Feb 12, 2024

    @ShoyuVanilla
    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 😄

  17. camsteffen commented on Feb 12, 2024

    @camsteffen
    Contributor

    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.

  18. RalfJung commented on Feb 12, 2024

    @RalfJung
    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.

  19. added 2 commits that reference this issue on Feb 12, 2024
  20. added a commit that references this issue on Feb 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

C-cleanupCategory: PRs that clean code up or issues documenting cleanup.E-mediumCall for participation: Medium difficulty. Experience needed to fix: Intermediate.E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions