I'm currently working under the assumption that the first application I'm going to write in Nim is going to be a client-server setup, where the client is 32-bit mobile, and the server is 64-bit Linux.
My "problem" is that I want both sides to behave in exactly the same way. Mathematical computations should produce _exactly_ the same result. And if the client is going to crash and burn with an integer overflow, then I want the server to also crash and burn with the same data at the same location. I don't want to have to run separate tests for the client and the server; I should expect the same results everywhere. Since one cannot rely on getting the same exact floating point results on two totally different processors, with different OS and standard math library function implementations, I'm going to try and not use any floating point data at all. In fact, I'm going to check later if I can use fixed-point in Nim somehow. The size of references/pointers is also going to be different. There is clearly nothing I can do there. Hopefully, I'll settle for some serialization library that takes care of this issue. What "bothers" me is, that the default integer type, int, is architecture-dependent. I _has_ to be, so that one can talk to the OS and standard libraries. But this also means that if I simply use int in my code, the size of data-structures, their alignment, and the points at which an integer overflows might happen, will differ between the client and the server. And that, is exactly the opposite of what I want to achieve. I could try to always explicitly use int32 and 42'i32 (or int64 and 42'i64) in my code, but beyond the fact that it would make the code more verbose, the bigger problem is that I might forget to do that somewhere, and I won't even know until I get an inexplicable "de-sync" between the client and the server. So, is there a way I could force a specific size for "int" _per module_, or some way I could get the compiler to produce an error, if it sees "raw int" (or float) used anywhere in my code (with, obviously, some way to disable that check for code that talks directly with other libraries or the OS)?
