Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upRFC: Renaming int/uint #464
Conversation
and others
added some commits
Nov 10, 2014
1fish2
referenced this pull request
Nov 13, 2014
Closed
RFC: int/uint portability to 16-bit CPUs #161
1fish2
pushed a commit
to 1fish2/Rust-rfcs
that referenced
this pull request
Nov 13, 2014
This comment has been minimized.
This comment has been minimized.
|
Another possible naming option would be |
This comment has been minimized.
This comment has been minimized.
|
cc me |
This comment has been minimized.
This comment has been minimized.
|
I disagree with the names |
This comment has been minimized.
This comment has been minimized.
|
@cmr I propose we delay the bikeshedding until this RFC is agreed upon (modulo the naming). |
This comment has been minimized.
This comment has been minimized.
gioele
commented
Nov 13, 2014
|
@tbu-: I am confused, what is to be agreed up if not the naming? The RFC states the proposal as
|
This comment has been minimized.
This comment has been minimized.
vks
commented
Nov 13, 2014
|
One issue that is not discussed in the RFC is that |
This comment has been minimized.
This comment has been minimized.
gioele
commented
Nov 13, 2014
|
Ranges have the same problem: it seems unnatural to have
|
This comment has been minimized.
This comment has been minimized.
vks
commented
Nov 13, 2014
|
@gioele The RFC assumes that a fallback to |
This comment has been minimized.
This comment has been minimized.
Thiez
commented
Nov 13, 2014
|
I have to agree with cmr here, it would be confusing if the |
This comment has been minimized.
This comment has been minimized.
l0kod
commented
Nov 13, 2014
|
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 |
This comment has been minimized.
This comment has been minimized.
arcto
commented
Nov 13, 2014
|
I think too that the |
This comment has been minimized.
This comment has been minimized.
l0kod
commented
Nov 13, 2014
|
Some discussions about the naming are in the forum and in #161. Some arguments found there :
That said, I like the |
This comment has been minimized.
This comment has been minimized.
vks
commented
Nov 13, 2014
|
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.) |
This comment has been minimized.
This comment has been minimized.
thestinger
commented
Nov 13, 2014
|
@vks: It's not correct to use |
This comment has been minimized.
This comment has been minimized.
thestinger
commented
Nov 13, 2014
|
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 |
glaebhoerl
reviewed
Nov 13, 2014
|
|
||
| - `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. |
This comment has been minimized.
This comment has been minimized.
glaebhoerl
Nov 13, 2014
Contributor
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.)
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
vks
commented
Nov 13, 2014
|
@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 |
This comment has been minimized.
This comment has been minimized.
thestinger
commented
Nov 13, 2014
|
It's a reason not to name the types |
pnkfelix
assigned
nrc
Nov 13, 2014
This comment has been minimized.
This comment has been minimized.
|
Great points, everyone. This revision gets in most of the feedback. |
This comment has been minimized.
This comment has been minimized.
|
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 |
This comment has been minimized.
This comment has been minimized.
vks
commented
Nov 14, 2014
|
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 |
This comment has been minimized.
This comment has been minimized.
l0kod
commented
Nov 14, 2014
Agree with @vks, moreover we would miss the opportunity to fix the code currently using Same argument for dropping |
This comment has been minimized.
This comment has been minimized.
arcto
commented
Nov 14, 2014
|
I also agree with @vks on I'd also like to give my +1 to either of these alternatives: |
This comment has been minimized.
This comment has been minimized.
|
Looking at all the suggestion here again, I think I could accept either of |
This comment has been minimized.
This comment has been minimized.
|
|
This comment has been minimized.
This comment has been minimized.
|
Is there anyone who prefers the names |
This comment has been minimized.
This comment has been minimized.
netvl
commented
Nov 25, 2014
|
@1fish2, yes, I personally think that |
This comment has been minimized.
This comment has been minimized.
jmesmon
commented
Nov 25, 2014
|
@1fish2 +1 |
This comment has been minimized.
This comment has been minimized.
|
(jf we are going to rename, I would prefer |
This comment has been minimized.
This comment has been minimized.
nodakai
commented
Nov 27, 2014
|
I totally agree with @glaebhoerl in both of these two points:
|
This comment has been minimized.
This comment has been minimized.
gulbanana
commented
Nov 27, 2014
|
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..) |
This comment has been minimized.
This comment has been minimized.
|
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 |
This comment has been minimized.
This comment has been minimized.
|
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"... |
This comment has been minimized.
This comment has been minimized.
l0kod
commented
Dec 14, 2014
|
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 |
This comment has been minimized.
This comment has been minimized.
|
@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! |
This comment has been minimized.
This comment has been minimized.
|
I want to add that I strongly prefer |
This comment has been minimized.
This comment has been minimized.
|
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 |
This comment has been minimized.
This comment has been minimized.
vks
commented
Dec 22, 2014
Does it tell you how many people voted on it? |
This comment has been minimized.
This comment has been minimized.
|
@vks The vote count is right above the picture for me. Currently 6 people have voted. |
This comment has been minimized.
This comment has been minimized.
|
iptr/uptr looks fine for me. imem/umem doesn't make sense because |
This comment has been minimized.
This comment has been minimized.
|
@liigo The reasoning for |
This comment has been minimized.
This comment has been minimized.
|
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 |
nrc
closed this
Dec 23, 2014
This comment has been minimized.
This comment has been minimized.
l0kod
commented
Dec 24, 2014
|
Despite all the favorable comments about this great RFC, the fear of a new breaking change (even before the 1.0 milestone) was greater... |
This comment has been minimized.
This comment has been minimized.
thestinger
commented
Dec 24, 2014
|
@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. |
This comment has been minimized.
This comment has been minimized.
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. |
This comment has been minimized.
This comment has been minimized.
thestinger
commented
Dec 24, 2014
|
@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. |
This comment has been minimized.
This comment has been minimized.
|
@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. |
This comment has been minimized.
This comment has been minimized.
thestinger
commented
Dec 24, 2014
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. |
This comment has been minimized.
This comment has been minimized.
stefanpenner
commented
Dec 24, 2014
|
Happy holidays everyone! |
This comment has been minimized.
This comment has been minimized.
franontanaya
commented
Dec 29, 2014
|
i0 as opposed to i32 and i64 would look to me like a not fixed size. |
This comment has been minimized.
This comment has been minimized.
thestinger
commented
Dec 29, 2014
|
@franontanaya: A pointer-size integer is not the only useful architecture-specific integer type. |
1fish2 commentedNov 13, 2014
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/uintportability bugs.While the new choice of names might be considered bikeshedding or not, moving away from long-held expectations on
int/uintset by other programming languages is a usability issue.