Kanbaru 🌟 (one hikari of too many)

(replying to Kanbaru 🌟 (one hikari of too many))

long long was a mistake

1 replies β†’
1 replies

Ridley @ WATCH LYCORECO

(replying to Kanbaru 🌟 (one hikari of too many))

@hikari long was a mistake, which later necessitated the creation of long long

Kanbaru 🌟 (one hikari of too many)

(replying to Ridley @ WATCH LYCORECO)

@rcombs well, short was definitely also a mistake, then

Ridley @ WATCH LYCORECO

(replying to Kanbaru 🌟 (one hikari of too many))

@hikari nah short is sane, it's 16-bit on all common desktop/server/etc platforms

Kanbaru 🌟 (one hikari of too many)

(replying to Ridley @ WATCH LYCORECO)

@rcombs but int being short or long depending on the platform makes me sad and has broken so much

Ridley @ WATCH LYCORECO

(replying to Kanbaru 🌟 (one hikari of too many))

@hikari where is int = short, outside embedded? (like, for the most part these days it's neither on 64-bit even?)

Kanbaru 🌟 (one hikari of too many)

(replying to Ridley @ WATCH LYCORECO)

@rcombs I mean yes we live in the 32-bit era now so desktops, laptops, phones and servers’ CPUs have sizeof(int) == 4, but embedded is a thing, and legacy OSes were a thing, and if you try to port legacy code to a modern OS you’ll suffer :p

Kanbaru 🌟 (one hikari of too many)

(replying to Kanbaru 🌟 (one hikari of too many))

…I said β€œthis doesn’t matter for C code”, but the way I tested this was with the _Generic macro (https://godbolt.org/z/v3c4n56jj), which is a C feature. also, you might be using really anal compiler flags…

Kanbaru 🌟 (one hikari of too many)

(replying to Kanbaru 🌟 (one hikari of too many))

ok are you ready for this? my hottest c take

int should be 64-bit on 64-bit platforms

Saagar Jha

(replying to Kanbaru 🌟 (one hikari of too many))
@hikari If you use Swift you can enjoy its ILP64 goodness

Kanbaru 🌟 (one hikari of too many)

(replying to Saagar Jha)

@saagar this is because of NSInteger isn't it? Objective-C is the only good C

Saagar Jha

(replying to Kanbaru 🌟 (one hikari of too many))
@hikari Maybe, but also that ILP64 is typically advantageous for compiler optimizations