4 ms·
There's a tradeoff around strictness of nominal types and evolvability, e.g. changing the threshold on such a strict type would be a breaking change.
by cle 5y ago
There's a tradeoff around strictness of nominal types and evolvability, e.g. changing the threshold on such a strict type would be a breaking change.
- yakubin 5y agoChanging the threshold without signaling the change in the type system is also a breaking change. It's just that your compiler won't warn you about it when you inevitably forget to update your code. Instead your code is going to break at runtime.
- cle 5y agoNot necessarily, it depends on what you do with the value.
- jstimpfle 5y agoObviously if you have at most 8/16/32/64 bit types (only making new types because of physical constraints), you'll have way, way fewer breaking changes than if you try to encode bounds extremely tightly and try to update them whenever you 2 instead of 1 somewhere. In fact most software is designed such that the physical sizes are chosen first, and then the practical bounds follow from that.