Ellery Newcomer wrote:
Question: would it be feasible to make D use some sort of bignum type as
the default index type for arrays, etc, but make it possible for the
programmer to use uint or ulong or whatever for e.g. places where
performance is an issue?
I suspect that's a big jump in complexity for very little gain.
I also suspect that it would result in a drastic performance problem (remember,
Python is 100x slower than native code), and will disable the advantages D has
with type inference (as the user will be back to explicitly naming the type).
I don't think there's much value left for add-on static analysis tools.
I went to the trouble of modifying dmd to warn on unsigned/signed
comparison. It found me some bugs which probably would not have been
noticed otherwise. Did it produce false positives? Yes. Did that make me
wish I hadn't done it? Hell no.
You might want to consider changing your coding style to eschew the use of
unsigned types.
The key idea is leave the
warnings off unless the programmer explicitly asks for it.
That's a good sentiment, but it doesn't work that way in practice. Warnings
always become de-facto requirements. They aren't the solution to a disagreement
about how the language should work.