-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
RFC: Renaming int/uint #464
Conversation
Another possible naming option would be |
cc me |
I disagree with the names |
@cmr I propose we delay the bikeshedding until this RFC is agreed upon (modulo the naming). |
@tbu-: I am confused, what is to be agreed up if not the naming? The RFC states the proposal as
|
One issue that is not discussed in the RFC is that |
Ranges have the same problem: it seems unnatural to have
|
@gioele The RFC assumes that a fallback to |
I have to agree with cmr here, it would be confusing if the |
I would also add the argument that the renaming process would be the good and probably only time to spot future bugs before they appear. There is also the question about integer suffixes A good example of using |
I think too that the |
Some discussions about the naming are in the forum and in #161. Some arguments found there :
That said, I like the |
I like the possibility of using different types for an address and a size, even if they are the same primitive type. It solves the problem that It might make simple loops that index all elements of a vector annoying if there is no implicit conversion though. (The highest possible address is the size - 1.) |
@vks: It's not correct to use |
I think we can separate the issue of whether they should be renamed to something to do with pointers / sizes from bikeshedding the specific names that are chosen. I strongly support the RFC, although I would prefer |
|
||
- `index` and `uindex`, named for their uses and preserving Rust's "i" and "u" integer prefixes. | ||
- `intptr` and `uintptr`, [borrowing from C's](http://en.cppreference.com/w/cpp/types/integer) `intptr_t` and `uintptr_t`. These names are awkward by design. | ||
- `isize` and `usize`, [borrowing from C's](http://en.cppreference.com/w/cpp/types/integer) `ssize_t` and `size_t` with Rust's "i/u" prefixes. But these types are defined as having the same number of bits as a pointer, not as a way of measuring sizes. A `usize` would be larger than needed for the largest memory node. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you might've meant to link to a different page here, because this one doesn't include {s
,}size_t
. Perhaps this one? (But even that doesn't mention ssize_t
.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@thestinger I agree that this is an artificial limitation, but I really don't see an alternative at the moment, because there is no I also like |
It's a reason not to name the types |
Incorporate most of the feedback so far. The first aim is to decide to rename `int` and `uint`. The second step is to pick the specific names. I see the second step as usability design, not really bikeshedding, but it is second. A quick-and-dirty usability test could be done. (Although I do like the case for `iptr` and `uptr`.) TODO: Add usage examples.
Great points, everyone. This revision gets in most of the feedback. |
I'm another vote for iptr and uptr. Short, simple, clear. I'd also still be interested in having a uint and int type as synonyms for u32 and i32 for a programmer to signal that the size of integers has not seriously been reflected upon. I get the impression this is what mostly people are using uint and int for outside of their "intended" use. This also matches precisely with when int fallback is expected to kick in: the programmer wanted numbers (possibly just as some vague dummy data), but hasn't clearly reflected on the types of these numbers. Not sure if this is out of scope for this RFC or not. I'm genuinely a little lost on the full hierarchy/relationship of all these different |
I'm not convinced having (I don't think that it is an unimportant detail that can be glossed over, because the programmer should be conscious about the limits of |
Agree with @vks, moreover we would miss the opportunity to fix the code currently using Same argument for dropping |
I also agree with @vks on I'd also like to give my +1 to either of these alternatives: |
I concur with prior commenters in that my particular preference among the possible alternative names is completely secondary to my preference for any alternative names. The core team can just settle that debate by choosing whichever names they like best, as long as it's not That said, my particular preference is still This page says:
Does or will Rust support any platforms where this does not hold? I think the other names are likely to be more confusing when someone first encounters them:
I think (Again though, I think any of these problems are smaller than the ones which |
Looking at all the suggestion here again, I think I could accept either of |
|
Is there anyone who prefers the names |
@1fish2, yes, I personally think that |
@1fish2 +1 |
(jf we are going to rename, I would prefer |
I totally agree with @glaebhoerl in both of these two points:
|
It'd be great to do away with the legacy of 'default ints' as variably sized. Most of the suggested names seem better than the status quo. (I like iptr and uptr personally; the primary argument against this is that it doesn't make sense unless you've learned things, but you have to learn those things to reasonably use rust..) |
It seems that the bikeshedding is stalled, but I hope this would land before 1.0. I try to use Personally I am OK with either |
I wrote in the intro:
but a BigInt type would fill the type inference fallback role at least as well. I should've written "a platform-independent integer type"... |
As Rust will soon reach 1.0 and because of the (invasive) breaking change, this RFC should quickly be accepted, otherwise it will never land. cc @pnkfelix |
@l0kod the Rust team discussed this at the work week (week before last), there is broad support for a renaming, but discussion about the details is ongoing and theirs still some work to do to find consensus. It's definitely on our minds though! |
I want to add that I strongly prefer |
I posted a poll on G+, phrasing it as a time-travelling C change to include programmers unfamiliar with Rust. Anyway, I agree that the main point is to change the name, and I personally prefer |
Does it tell you how many people voted on it? |
@vks The vote count is right above the picture for me. Currently 6 people have voted. |
iptr/uptr looks fine for me. imem/umem doesn't make sense because |
@liigo The reasoning for |
This was discussed a lot by the Rust team and the core team and, eventually, decided against. See this post for more of the reasoning behind the decision |
Despite all the favorable comments about this great RFC, the fear of a new breaking change (even before the 1.0 milestone) was greater... 😞 |
@l0kod: It's clearly not why because changes like opt-in Copy or most of the other recent breaks were harder to deal with than a guided search / replace. The second stated rationale is the issue of familiarity which is clearing missing the entire point. Familiarity is a bad thing because these types are defined differently in other languages. No one is going to infer that The decision was made based on closed-door discussions without people who understood the motives behind the RFC. The public explanation likely has very little to do with the conversions that actually occurred. I don't know why anyone would still expect the core developers to be open and honest. |
I'm genuinely unsure what you mean by this. Maybe there's an ultra-secret core group that is making decisions without me and has even more ultra-secret motivations, but at least for me, the stated rationale is the rationale we discussed as a group. |
@wycats: I don't place much weight in the word of someone who makes personal attacks on me in private discussions after putting on a completely different persona in conversions with me. I know for a fact that there's even internal dissent about the way this went down because I was told by at least one person who was there. |
@thestinger I'm pretty sure I would tell you (to your face) anything I've said in private to anyone. I think that you are very talented and have many very good insights on issues. I believe that Mozilla has a need to grow the core team so it includes people who are not employees of Mozilla, and I have strongly advocated for that for nearly a year now. I also believe that if you're worried about Mozilla influence, your best bet is on the continued growth of the Rust community, who will naturally dilute the influence that Mozilla has now as one of only a few companies paying multiple people to write Rust code every day. On the flip side, I feel that you have been both technically sloppy and vitriolic in your comments (this is not a personal attack, just an observation). I feel that the way that you talk about Rust and the core team is actually more likely to leave a trail of damage in your wake than achieve your goals of more diversified decisionmaking. In private, I have absolutely vented about the frustrating way you have chosen to engage with the community. The frustrating thing for me is that I have largely agreed historically with many of your technical critiques and your organizational critiques, but I've watched the core team (both before and after I joined) take your concerns extremely seriously. They haven't always agreed with you at the end of the day, but they have spent countless hours seriously engaging with every technical critique you've raised, and have often come to agree with you. In response, you have ratcheted up the level of vitriol and conspiracy theorizing, and have repeatedly and publicly threatened to fork Rust. I'll ask you again what I asked you in private: if you're interested in the success of Rust, please try to work as a collaborator, rather than as an enemy. I would welcome collaboration with both arms. |
That's clearly not true, as you pointed out yourself later in this comment.
Including contractors instead of just normal employees isn't much of a change.
The problem isn't the influence of Mozilla. It's the fact that there's so much influence by people with no respect for the community or the project. It's a problem with people who are unable to approach technical issues without their personal bias / feuds getting in the way and who resort to dishonest, manipulative tactics to push their point of view. Mozilla's involvement just guarantees that these will continue to be the people in charge.
This is just laughable bullshit. The only time I'm vitriolic is in response to two-faced liars like yourself. I think FUD deserves to be called out, as does nasty political nonsense like like certain people who felt it necessary to block my pull requests with whatever pile of bullshit reasons they could pull out of their ass. You calling my contributions technically sloppy is just a projection of your own incompetence. You don't have any real arguments to make so you're just going to totally misrepresent the facts. That's the usual pattern that I've grown to expect.
I suggest cutting down on the FUD and manipulative tactics if you don't want to be called out on it.
I've only "chosen to engage" like this with a select few people on the core team. People who habitually resort to lying / manipulation / politics have no place managing a community like this.
This isn't about technical issues. The problem is a lack of openness, manipulation, lying, taking credit for other people's ideas / work, putting procedure above common sense and letting personal politics drive decision making / actions rather than the good of the project.
Once again, you're using manipulative language like "conspiracy theorizing" to white-wash real cases where the community has be abused. You're the one ratcheting up the vitriol by misrepresenting everything and resorting to so much passive aggression.
I have no interest in collaborating with pathological liars. You said a lot of things to me in private that I've had to re-evaluate after finding out it was just a show. |
Happy holidays everyone! |
i0 as opposed to i32 and i64 would look to me like a not fixed size. |
@franontanaya: A pointer-size integer is not the only useful architecture-specific integer type. |
This RFC adopts Daniel Micay's suggestion to replace RFC: int/uint portability to 16-bit CPUs with a single-purpose RFC to just rename
int
/uint
.This RFC assumes a fixed-size integer type will become the type inference fallback and thus the language's "default integer type" and, in turn, heavily used in tutorials and libraries. See RFC: Change integer fallback RFC to suggest i32 instead of int as the fallback.
What changed since Daniel's original RFC on this issue?
int
/uint
portability bugs.While the new choice of names might be considered bikeshedding or not, moving away from long-held expectations on
int
/uint
set by other programming languages is a usability issue.