"systems" programming languages where you care about things like fixed size integers, should have ranged number types and they should force you to deal with potential overflows explicitly when you're going from a larger range to a shorter range

e.g. if you try to add two 32 bit integers (with no explicit range) and store the result in a 32 bit integer, you will need to deal with the overflow. but if your initial 32 bit integers had an explicit range, the result might not need an overflow check.

Follow

@typeswitch IMO it'd be better if they had boolean expressions over bits that have to be satisfied. That would also handle various weird bit-packing and assurances of divisibility by a constant.

Sign in to participate in the conversation
Qoto Mastodon

QOTO: Question Others to Teach Ourselves
An inclusive, Academic Freedom, instance
All cultures welcome.
Hate speech and harassment strictly forbidden.