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

Decide on name for Freeze #131401

Open
traviscross opened this issue Oct 8, 2024 · 17 comments
Open

Decide on name for Freeze #131401

traviscross opened this issue Oct 8, 2024 · 17 comments
Labels
C-discussion Category: Discussion or questions that doesn't represent real issues. disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it. I-lang-nominated Nominated for discussion during a lang team meeting. proposed-final-comment-period Proposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off. T-lang Relevant to the language team, which will review and decide on the PR/issue.

Comments

@traviscross
Copy link
Contributor

We still need to pick a name for Freeze (which may still be Freeze) so that we can proceed with:

Thoughts?

cc @rust-lang/lang

@rustbot labels +T-lang +I-lang-nominated

@rustbot rustbot added needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. I-lang-nominated Nominated for discussion during a lang team meeting. T-lang Relevant to the language team, which will review and decide on the PR/issue. labels Oct 8, 2024
@traviscross traviscross added C-discussion Category: Discussion or questions that doesn't represent real issues. and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Oct 8, 2024
@p-avital
Copy link

p-avital commented Oct 8, 2024

I'm reiterating my proposal from Zulip: keeping Freeze, and instead giving llvm's freeze a more explicit name. To quote myself from there:

I might just be misunderstanding the docs for the intrinsic, but it feels like it'd translate well to a MaybeUninit::read (as opposed to assume_init_read), or maybe deterministic_read or something alike to avoid it looking simpler than the current assume_init set

@traviscross
Copy link
Contributor Author

Let's see whether we have consensus to simply call it Freeze.

@rfcbot fcp merge

@rfcbot
Copy link

rfcbot commented Oct 8, 2024

Team member @traviscross has proposed to merge this. The next step is review by the rest of the tagged team members:

Concerns:

Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up!

cc @rust-lang/lang-advisors: FCP proposed for lang, please feel free to register concerns.
See this document for info about what commands tagged team members can give me.

@rfcbot rfcbot added proposed-final-comment-period Proposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off. disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it. labels Oct 8, 2024
@joshtriplett
Copy link
Member

I'm reiterating my proposal from Zulip: keeping Freeze, and instead giving llvm's freeze a more explicit name. To quote myself from there:

I might just be misunderstanding the docs for the intrinsic, but it feels like it'd translate well to a MaybeUninit::read (as opposed to assume_init_read), or maybe deterministic_read or something alike to avoid it looking simpler than the current assume_init set

I don't know if Freeze is the best name for this trait, but I definitely agree that freeze is not the best name for the the LLVM concept.

@joshtriplett
Copy link
Member

@rfcbot concern should-be-self-documenting-about-interior-mutability

I think we should use a name that's self-documenting and evokes the concept of interior mutability in some way.

@Scripter17
Copy link
Contributor

Would Frozen work?

@Amanieu
Copy link
Member

Amanieu commented Oct 23, 2024

I'm partial to the name InteriorImmutable for the Freeze trait (which was actually one of the alternatives listed in the RFC). All of the cell-related documentation already uses the term "interior mutability" and the trait name makes it clear that it means that the type does not contain a cell.

@traviscross
Copy link
Contributor Author

Stylistically, we don't end trait names with "-able". We have Copy and not Copyable, e.g. We just leaned on this principle in deciding to go with derive(CoercePointee) rather than various "-able" options in:

That is, trait names imply the capability to do the thing named in the trait.

What would be the version of an "interior immutable"-style name that matches that?

@Amanieu
Copy link
Member

Amanieu commented Oct 23, 2024

While "mutable" has a verb form "mutate", there isn't any verb equivalent of "immutable" ("not mutate"?). I would therefore argue for an exception to the -able policy for this specific case since "immutable" very clearly captures what this trait is promising.

An alternative that also captures the concept of interior mutability are might be NoInteriorMutate, but that just looks worse than InteriorImmutable since we're just arbitrarily avoiding the -able suffix.

@hkBst
Copy link
Contributor

hkBst commented Oct 23, 2024

Some variants to get the juices going:

  • NoInteriorMut / NoInternalMut / InternalNoMut / InternallyNoMut / InteriorNoMut,
  • NoInteriorChange / NoInternalChange / InternalNoChange / InteriorNoChange,
  • InternalConst / InternallyConst / InteriorConst`,
  • NoMut / NoChange
  • Changeless
  • Constant

@RalfJung
Copy link
Member

RalfJung commented Oct 23, 2024 via email

@traviscross
Copy link
Contributor Author

traviscross commented Oct 24, 2024

What @RalfJung said is why I don't hate Freeze, as we can read it as "has the ability to be frozen when taking a reference to it," where "frozen" here means "will not change".

I.e., inventing some notation, we could imagine the trait as:

trait Freeze {
    fn freeze(&self) -> &frozen Self;
}

@thynson
Copy link

thynson commented Nov 11, 2024

Maybe InteriorFreeze or FreezeInterior?

@traviscross
Copy link
Contributor Author

traviscross commented Nov 11, 2024

I could live with FreezeInterior (ed: but probably still prefer Freeze). It has a similar ring to it as what we did with CoercePointee.

@p-avital
Copy link

@traviscross I'd prefer Freeze to FreezeInterior, as I don't feel the addition of interior buys any clarity, while it does come at the cost of renaming which would make split resources for people looking it up; but at this point, I'm just ready to go with anything that grabs enough traction to finally get stabilized 🫠

@p-avital
Copy link

@traviscross This RFC is becoming stale again, with bike-shedding around the trait's name looking like the main blocker.

Do you think setting a deadline on the decision of naming (and possibly a poll with some of the existing options) could help push forward?

@traviscross
Copy link
Contributor Author

It's a good point. We just need to allocate some time for it in a meeting and commit to the bikeshed. There's a meeting in mid December we have scheduled that would probably make sense for that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-discussion Category: Discussion or questions that doesn't represent real issues. disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it. I-lang-nominated Nominated for discussion during a lang team meeting. proposed-final-comment-period Proposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off. T-lang Relevant to the language team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

10 participants