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

Meeting proposal: rename "object safety" to "dyn compatibility" #286

Closed
notriddle opened this issue Aug 4, 2024 · 9 comments
Closed

Meeting proposal: rename "object safety" to "dyn compatibility" #286

notriddle opened this issue Aug 4, 2024 · 9 comments
Labels
disposition-merge The FCP starter wants to merge (accept) this finished-final-comment-period T-lang to-announce Not yet announced MCP proposals

Comments

@notriddle
Copy link
Contributor

Summary

Instead of calling them "object safe," refer to traits that support vtables as being "dyn compatible."

Background reading

https://internals.rust-lang.org/t/object-safety-is-a-terrible-term/21025

About this issue

This issue corresponds to a lang-team design meeting proposal. It corresponds to a possible topic of discussion that may be scheduled for deeper discussion during one of our design meetings.

@notriddle notriddle added meeting-proposal Proposal for a lang team design meeting T-lang labels Aug 4, 2024
@notriddle notriddle changed the title Meeting proposal: rename "object safety" to "dyn compatibility Meeting proposal: rename "object safety" to "dyn compatibility" Aug 4, 2024
@joshtriplett joshtriplett removed the meeting-proposal Proposal for a lang team design meeting label Sep 9, 2024
@joshtriplett
Copy link
Member

We talked about this at today's meeting, and we're generally in favor of making this change. Starting an FCP to confirm.

@rfcbot merge

@rfcbot
Copy link
Collaborator

rfcbot commented Sep 9, 2024

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

No concerns currently listed.

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 disposition-merge The FCP starter wants to merge (accept) this labels Sep 9, 2024
@traviscross
Copy link
Contributor

@rfcbot reviewed

I agree that dyn compatible is a better term to describe which traits may be used with dyn. Specifically, I'd probably frame it that dyn-safety / trait object safety is something that Rust ensures, and that what it requires from users is that they write dyn compatible traits.

@rfcbot rfcbot added final-comment-period The FCP has started, most (if not all) team members are in agreement and removed proposed-final-comment-period labels Sep 17, 2024
@rfcbot
Copy link
Collaborator

rfcbot commented Sep 17, 2024

🔔 This is now entering its final comment period, as per the review above. 🔔

@traviscross
Copy link
Contributor

cc @ehuss

@fmease
Copy link
Member

fmease commented Sep 25, 2024

@traviscross
Copy link
Contributor

I've created a tracking issue for this here:

@rfcbot rfcbot added finished-final-comment-period to-announce Not yet announced MCP proposals and removed final-comment-period The FCP has started, most (if not all) team members are in agreement labels Sep 27, 2024
@rfcbot
Copy link
Collaborator

rfcbot commented Sep 27, 2024

The final comment period, with a disposition to merge, as per the review above, is now complete.

As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed.

This will be merged soon.

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Sep 27, 2024
…mpat, r=compiler-errors

Compiler: Rename "object safe" to "dyn compatible"

Completed T-lang FCP: rust-lang/lang-team#286 (comment).
Tracking issue: rust-lang#130852

Excludes `compiler/rustc_codegen_cranelift` (to be filed separately).
Includes Stable MIR.

Regarding https://github.com/rust-lang/rust/labels/relnotes, I guess I will manually open a https://github.com/rust-lang/rust/labels/relnotes-tracking-issue since this change affects everything (compiler, library, tools, docs, books, everyday language).

r? ghost
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Sep 28, 2024
Rollup merge of rust-lang#130826 - fmease:compiler-mv-obj-safe-dyn-compat, r=compiler-errors

Compiler: Rename "object safe" to "dyn compatible"

Completed T-lang FCP: rust-lang/lang-team#286 (comment).
Tracking issue: rust-lang#130852

Excludes `compiler/rustc_codegen_cranelift` (to be filed separately).
Includes Stable MIR.

Regarding https://github.com/rust-lang/rust/labels/relnotes, I guess I will manually open a https://github.com/rust-lang/rust/labels/relnotes-tracking-issue since this change affects everything (compiler, library, tools, docs, books, everyday language).

r? ghost
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Oct 9, 2024
…pat, r=ibraheemdev

Library: Rename "object safe" to "dyn compatible"

Completed T-lang FCP: rust-lang/lang-team#286 (comment).
Tracking issue: rust-lang#130852

Regarding https://github.com/rust-lang/rust/labels/relnotes, I guess I will manually open a https://github.com/rust-lang/rust/labels/relnotes-tracking-issue since this change affects everything (compiler, library, tools, docs, books, everyday language).

r? ghost
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Oct 10, 2024
Rollup merge of rust-lang#130827 - fmease:library-mv-obj-save-dyn-compat, r=ibraheemdev

Library: Rename "object safe" to "dyn compatible"

Completed T-lang FCP: rust-lang/lang-team#286 (comment).
Tracking issue: rust-lang#130852

Regarding https://github.com/rust-lang/rust/labels/relnotes, I guess I will manually open a https://github.com/rust-lang/rust/labels/relnotes-tracking-issue since this change affects everything (compiler, library, tools, docs, books, everyday language).

r? ghost
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Oct 16, 2024
…pat, r=notriddle

rustdoc: Rename "object safe" to "dyn compatible"

Supersedes rust-lang#126554:

1. In line with [T-lang's latest resolution](rust-lang/lang-team#286 (comment)).
2. More comprehensive: Not only updates user-facing text but also source code.

Part of rust-lang#130852.

Doesn't update rustdoc-JSON (will be filed separately).

r? `@notriddle` (rust-lang/lang-team#286) `@GuillaumeGomez` (for visibility)
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Oct 16, 2024
Rollup merge of rust-lang#131594 - fmease:rustdoc-mv-obj-safe-dyn-compat, r=notriddle

rustdoc: Rename "object safe" to "dyn compatible"

Supersedes rust-lang#126554:

1. In line with [T-lang's latest resolution](rust-lang/lang-team#286 (comment)).
2. More comprehensive: Not only updates user-facing text but also source code.

Part of rust-lang#130852.

Doesn't update rustdoc-JSON (will be filed separately).

r? `@notriddle` (rust-lang/lang-team#286) `@GuillaumeGomez` (for visibility)
github-actions bot pushed a commit to rust-lang/miri that referenced this issue Oct 17, 2024
…triddle

rustdoc: Rename "object safe" to "dyn compatible"

Supersedes #126554:

1. In line with [T-lang's latest resolution](rust-lang/lang-team#286 (comment)).
2. More comprehensive: Not only updates user-facing text but also source code.

Part of #130852.

Doesn't update rustdoc-JSON (will be filed separately).

r? `@notriddle` (rust-lang/lang-team#286) `@GuillaumeGomez` (for visibility)
lnicola pushed a commit to lnicola/rust-analyzer that referenced this issue Oct 17, 2024
…raheemdev

Library: Rename "object safe" to "dyn compatible"

Completed T-lang FCP: rust-lang/lang-team#286 (comment).
Tracking issue: rust-lang/rust#130852

Regarding https://github.com/rust-lang/rust/labels/relnotes, I guess I will manually open a https://github.com/rust-lang/rust/labels/relnotes-tracking-issue since this change affects everything (compiler, library, tools, docs, books, everyday language).

r? ghost
@traviscross traviscross moved this from Needs triage to Closed in T-lang design meeting schedule Nov 6, 2024
@traviscross traviscross moved this from Done to Closed in T-lang design meeting schedule Nov 6, 2024
@cher-nov
Copy link

cher-nov commented Nov 23, 2024

To be honest, the whole "trait object" term is awful.

  1. Traits themselves are not instantiable and therefore cannot be objects in the common sense of this word. Quite the contrary: it is a type that is the subject of trait-imputed behavior.

  2. This term has a strong association with the object-oriented paradigm and thereby is simply misleading. I understand the obvious need to refer to "dynamic dispatch", "late binding" and "virtual methods", but it would be much more logical just to use (one of) them directly and make a disclaimer "you know, this is what we ended up using instead of OOP in this (part of the) universe".

See, for example, here for an example of confusion:
https://stackoverflow.com/questions/27567849/what-makes-something-a-trait-object

Frankly, I'd be happy to see one day an RFC covering reduction of the amount of self-inflicted and arbitrarily homegrown terminology in Rust, with the case of UFCS term misuse being an obvious example of this from the past.
https://en.wikipedia.org/w/index.php?title=Uniform_Function_Call_Syntax&oldid=1247021182#Rust_usage_of_the_term
https://doc.rust-lang.org/1.82.0/reference/expressions/call-expr.html#disambiguating-function-calls
rust-lang/rfcs#1140
rust-lang/rfcs#3366
I do not consider writing it myself due to lack of the Rust language knowledge (I am still learning it) and the ashaming level of my English.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
disposition-merge The FCP starter wants to merge (accept) this finished-final-comment-period T-lang to-announce Not yet announced MCP proposals
Projects
Status: Closed
Development

No branches or pull requests

6 participants