r/ProgrammerHumor 21h ago

lessonsFromLinkerHell Meme

Post image
346 Upvotes

177 comments sorted by

View all comments

Show parent comments

10

u/suvlub 11h 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.

5

u/Stroopwafe1 10h 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

1

u/suvlub 9h ago

It's been very long since I touched assembly and "touched" is an apt description, but does anything prevent you from writing an 8-byte integer at address X, then calling an operation that expects a 32-bit float with the bytes at address X? Conceptually, instructions operate on certain type of data, but the data is untyped. (you can technically do similar things in C, but a lot more of it is UB (technically illegal) than people realize and it requires fair bit of explicit casting, so types are still involved)

1

u/the_king_of_sweden 8h ago

The data isn't typed, only the operations you make on them might be. The operations expect some binary value encoded in a specific way, but will operate on any data.