Thanks all for your comments. Just a few clarification:

  * I want to use [UE4](https://www.unrealengine.com), and AFAIK, it expects 
C++ _source_ code. So D/GO/... won't cut it.
  * I don't think I need "unlimited precision", but I also forgot about bignum; 
it's already available, and should produce the same results anywhere, which is 
my main requirement. Maybe I really should start with that, until proven that 
it causes performance problems. OTOH, I do prefer fixed-size (allocation free) 
data-types whenever possible.
  * int vs uint, or int64 vs uint64, is not really a concern for me. I usually 
code in Java, where we don't even _have_ a uint/uint64. On the one hand, if a 
value is unsigned, and the valid lower bound is 0, then you never have to check 
the lower bound. OTOH, I remember from reading "The C++ programming language" 
recently, that one should use signed values even if negative values are not 
valid, because it's likely bad data is going to be negative, so with an int, 
you have a better chance of catching bugs. And catching bugs has higher 
priority then removing the "lower bound check".
  * Whenever I define an object field, I _have to_ decide how big it will be; I 
see this as a critical design decision. So it's no big deal using int32 or 
int64 instead of int. Specifying the type of all the literal constants is 
rather more tiresome. But that is just an "annoyance", not really a "problem". 
The "problem" is that I don't trust myself to always remember to be explicit. I 
don't even have someone to do code-review, so some compiler/tool support would 
have been welcome. I guess I can just start by checking my code with a regex, 
as suggested, and eventually write a macro instead, if I the regex cannot cover 
all corner-cases.


Reply via email to