Restarting the `int/uint` Discussion

The term “default” here is not, as you say, a technical “part” of the language. Nonetheless, it is common for people to have a “go to” integer type that they pick first. This is what the default is, and Yehuda’s point (I think) is that people will pick int or uint, whatever we say, so we might as well align int/uint with what we think the best overall choice would be. (I think integral fallback is mostly a red-herring, since it really only applies in small one-off programs or other random integers floating about, typically 0 or 1.)

Also, a point of clarification. By “register-sized integer types”, I presume you mean “fastest size”? I mean, on an x64 system, there are at least some registers with every possible width, so the term is not particularly precise. In any case, it is certainly true that none of the listed proposals included variable-size integer types except for pointer-sized (and they all assume a flat address space as well). This is no accident. Speaking for myself, I think we need to keep the zoo of integer size types to a minimum, and options like “fastest integer size” don’t carry their weight. Every machine-dependent type carries overflow and portability hazards along with it, and if you really really care about using the “fastest” possible type, it’s easy enough to define your own aliases with a #[cfg] switch.

1 Like