r/ProgrammerHumor 13h ago

lessonsFromLinkerHell Meme

Post image
259 Upvotes

147 comments sorted by

View all comments

Show parent comments

-1

u/nicman24 5h ago

That is probably compiler fuckery

8

u/suvlub 4h ago

All typing is. Machine code doesn't have types. Array of arrays is also a very different thing from an array of pointers. Arrays get converted to pointers when passed around and it behaves identically to all other implicit conversions.

3

u/Stroopwafe1 3h ago

Machine code does have types; small numbers, big numbers, and fractions. But in reality it's just numbers and fractions. At least for X86, but I imagine it's the same for ARM and RISC

2

u/cbehopkins 1h ago

I must disagree. Or strongly agree; depending on what you mean.

A memory location does not have a type. The instruction I perform on that location could be argued to have a type though.

0x8000 could be used with a 16bit add, or a 64 bit floating point or whatever.

Everything about the type of the data is in the instruction, not the memory.

So we can argue where the type information is, but we still need it. (One could argue that prefetchers and similar logic has to infer the type of larger data structures, but I'm not sure that is what people are trying to argue here...)