The optimization I'm referring to is widening a 32-bit loop IV to 64-bit so it can stay in a register: https://gist.github.com/rygorous/e0f055bfb74e3d5f0af20690759...
size_t obviates the need for this optimization.
size_t obviates the need for this optimization.
"int count; … for (int i = 0; i < count; ++i) {}" can't overflow so the optimization is always valid.
"int count; … for (int i = 0; i < count; i += 2) {}" is more of a problem.
I don't think "have a 64-bit int type" is the right approach for a new language either… we should be aiming for safety. If a variable's valid values are 0-50 then its type should be "integer between 0 and 50", not "integer between 0 and UINT64_MAX". Storage size should be an implementation detail.
Look for the "range" keyword