4 ms·
I agree, and there is tooling to do this kind of thing with C/C++. If this was embedded into the language, you'll quickly learn that static checking has its lim
by archi42 3y ago
I agree, and there is tooling to do this kind of thing with C/C++.
If this was embedded into the language, you'll quickly learn that static checking has its limits; dynamic checking introduces a new class of failure mode into your embedded, safety critical (as in kills or destroys) system, which might also not be what you want.
It's a conundrum :(
The second statement contradicts the first - int16_t is too specific and hides errors, but an arbitrary range is not?
- astrange 3y ago> The second statement contradicts the first - int16_t is too specific and hides errors, but an arbitrary range is not? The arbitrary range is actually capable of being correct. int16_t is almost never "correct", since it's larger than the actual range of values. It can also be said to be an over-optimization, since on some platforms like x86 it's easier to deal with 32-bit values than 16-bit ones.
- archi42 3y agoThe compiler takes care of this kind of optimization via static analysis. And who said x86? You're right, but what about Power9 register windows vs the three-and-a-half brain cells of x86? I'm not in the mood of discussing this or convincing you otherwise. If you made up your mind to use int over intWhatever_t then so be it. We're not working on the same project and I suppose you're not building anything that might kill me.