Cesium icon indicating copy to clipboard operation
Cesium copied to clipboard

long long should be System.Int128

Open ForNeVeR opened this issue 2 years ago • 4 comments

I think that it would be fun to have long long of size 128 bit. .NET 7 includes System.Int128. Let's consider making long long as Int128 on .NET 7?

Perhaps this will require us to either switch to .NET 7 or provide a separate variant of stdlib for that, this is okay I guess.

ForNeVeR avatar Jun 22 '22 16:06 ForNeVeR

Please don't do that - there is int128 (even if it is an extension) in C, this is what you should map to Int128.

GitMensch avatar Feb 08 '24 22:02 GitMensch

Please tell me why not? What's the mind set of the person who uses long long in their C code but don't want it to be bigger than just long?

ForNeVeR avatar Feb 08 '24 22:02 ForNeVeR

C programmers want to have it longer than an int :-) [this is all related to decades of history) For longer types they use __int128.

And of course, this would break the ABI into native modules :-)

GitMensch avatar Feb 08 '24 22:02 GitMensch

Since this is a contradictory idea (I have to admit), we will likely add an option to disable it.

When talking about ABI boundaries, I believe more options would be needed, such as some kind of "ABI profiles" (to make long shorter when interoprating with MSVC-compiled code). We'll see about that.

ForNeVeR avatar Feb 08 '24 22:02 ForNeVeR