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

Explicate what "Rc" and "Arc" stand for. #42419

Merged
merged 2 commits into from
Jun 12, 2017

Conversation

ucarion
Copy link
Contributor

@ucarion ucarion commented Jun 4, 2017

A person on the weekly "Easy Questions" Reddit thread was mystified by what Arc/Rc means. Though this is explained in various places, it's not mentioned in the documentation directly.

This PR adds an explanation of the Rc/Arc acronyms to their respective documentations. There are two things I'm not sure of:

  • Does "Rc" mean "Reference Counter" or "Reference Counted"? I went with the former. Edit: I've changed this to use the latter alternative.
  • Should this information be spelled out elsewhere, such as in the docs for the rc module?

@rust-highfive
Copy link
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @sfackler (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@@ -10,7 +10,8 @@

#![allow(deprecated)]

//! Single-threaded reference-counting pointers.
//! Single-threaded reference-counting pointers. "Rc" stands for "Reference
Copy link
Member

Choose a reason for hiding this comment

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

I think of Rc as "reference counted", not "reference counter" personally, and Arc as "atomically reference counted".

Copy link
Contributor Author

Choose a reason for hiding this comment

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

After reflection, I was reaching the same conclusion. I'll fix the PR.

Copy link
Contributor

Choose a reason for hiding this comment

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

When I compare "atomically reference-counted" with "atomic reference counter," the tech-jargon-ness of the former seems a bit stronger than that of the latter. Just my personal impression.

@sfackler
Copy link
Member

sfackler commented Jun 4, 2017

@rust-lang/docs

@ucarion ucarion force-pushed the ucarion-explain-rc-arc-abbrev branch from 27b4e40 to 8d9df99 Compare June 4, 2017 04:47
@frewsxcv frewsxcv added the A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools label Jun 4, 2017
@abrugh
Copy link

abrugh commented Jun 4, 2017

Hey There. Thanks @ucarion for creating a change request for me. Just commenting to add context. Here's the comment in question from reddit.

@steveklabnik
Copy link
Member

Does "Rc" mean "Reference Counter" or "Reference Counted"? I went with the former. Edit: I've changed this to use the latter alternative.

Yes, the latter is correct.

Should this information be spelled out elsewhere, such as in the docs for the rc module?

That might be a good idea, yes 😄

@@ -42,7 +42,8 @@ use heap::deallocate;
/// necessarily) at _exactly_ `MAX_REFCOUNT + 1` references.
const MAX_REFCOUNT: usize = (isize::MAX) as usize;

/// A thread-safe reference-counting pointer.
/// A thread-safe reference-counting pointer. "Arc" stands for "Atomically
Copy link
Member

Choose a reason for hiding this comment

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

Both of these should be single quotes

@carols10cents carols10cents added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Jun 5, 2017
@ucarion
Copy link
Contributor Author

ucarion commented Jun 5, 2017

Should this information be spelled out elsewhere, such as in the docs for the rc module?

That might be a good idea, yes 😄

@steveklabnik I misspoke -- I had added those docs to the rc module all along. With the latest commit, I also added docs to the Rc struct as well. (I also switched to single quotes)

@arielb1 arielb1 added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jun 6, 2017
@frewsxcv
Copy link
Member

This looks great, thanks!

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Jun 12, 2017

📌 Commit 1af0cb1 has been approved by frewsxcv

@frewsxcv frewsxcv added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 12, 2017
@bors
Copy link
Contributor

bors commented Jun 12, 2017

⌛ Testing commit 1af0cb1 with merge 54eeef1...

bors added a commit that referenced this pull request Jun 12, 2017
Explicate what "Rc" and "Arc" stand for.

A person on the weekly "Easy Questions" Reddit thread [was mystified by what `Arc`/`Rc` means](https://www.reddit.com/r/rust/comments/6dyud9/hey_rustaceans_got_an_easy_question_ask_here/did87ds/). Though this is explained in various places, it's not mentioned in the documentation directly.

This PR adds an explanation of the `Rc`/`Arc` acronyms to their respective documentations. There are two things I'm not sure of:

* Does "Rc" mean "Reference Count**er**" or "Reference Count**ed**"? ~~I went with the former.~~ *Edit:* I've changed this to use the latter alternative.
* Should this information be spelled out elsewhere, such as in the docs for the `rc` module?
@bors
Copy link
Contributor

bors commented Jun 12, 2017

☀️ Test successful - status-appveyor, status-travis
Approved by: frewsxcv
Pushing 54eeef1 to master...

@bors bors merged commit 1af0cb1 into rust-lang:master Jun 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants