4 ms·
People have written C++ libraries for integer type generation that allow you to specify many properties including various types of arithmetic and runtime behavi
by jandrewrogers 6y ago
People have written C++ libraries for integer type generation that allow you to specify many properties including various types of arithmetic and runtime behavior. It is pretty transparent to the programmer and efficient.
However, there is real complexity, in terms of library implementation, in figuring out how this zoo of exotic integer types interact with each other consistently and correctly. Doubly so if you want the safety of these interactions to be verified at compile-time to the extent possible.
- amelius 6y agoI think you also want to use the hardware capabilities of the target platform (overflow detection, automatic trapping) as much as possible and at the same time also allow all other integer arithmetic optimizations. Not sure if all of this can be done from within a user library.
- heavenlyblue 6y ago> in figuring out how this zoo of exotic integer types interact with each other consistently and correctly You just allow to copy them from one to another and allow other operations to only be done on the same types of integers.