←back to thread

The C23 edition of Modern C

(gustedt.wordpress.com)
515 points bwidlar | 1 comments | | HN request time: 0s | source
Show context
eqvinox ◴[] No.41858531[source]
> The storage order, the endianness, as given for my machine, is called little-endian. A system that has high-order representation digits first is called big-endian. Both orders are commonly used by modern processor types. Some processors are even able to switch between the two orders on the fly.

Calling big endian "commonly used by modern processor types" when s390x is really the only one left is a bit of a stretch ;D

(Comments about everyone's favorite niche/dead BE architecture in 3… 2… 1…)

replies(7): >>41858643 #>>41858658 #>>41858663 #>>41859666 #>>41860712 #>>41860854 #>>41866505 #
throwaway19972 ◴[] No.41858658[source]
"Modern" doesn't mean "currently widespread".
replies(1): >>41858788 #
eqvinox ◴[] No.41858788[source]
Indeed, if it meant "currently widespread" there'd be a stronger argument for Big Endian with a lot of MIPS and PPC chugging away silently. But interpreting "modern" as recent development, BE is close to gone.
replies(1): >>41858814 #
throwaway19972 ◴[] No.41858814{3}[source]
Is there some end to this criticism or do you have some stake in dismissing big endian architectures?
replies(1): >>41858872 #
eqvinox ◴[] No.41858872{4}[source]
Uh, why so serious? I called it "a bit of a stretch ;D" - there was a reason for that smiley. I'm well aware BE is alive enough to be around.

If you can't live without knowing, sure, my stake in dismissing big endian architectures is that I can't in fact dismiss BE architectures because I have users on it. And it's incredibly painful to test because while my users have such hardware, actually buying a good test platform or CI system is close to impossible. (It ended up being Freescale T4240-QDS devkits off eBay. Not a good sign when the best system you can get is from a company that doesn't exist anymore.)

And at some point it's a question about network protocols/encodings being designed to a "network byte order" determined in the 80s to be big endian. When almost everything is LE, maybe new protocols should just stick with LE as well.

replies(2): >>41859027 #>>41860156 #
pm215 ◴[] No.41859027{5}[source]
To be fair to IBM, with s390x they do have a "community cloud" programme where open source projects can apply to get a Linux s390x VM to use for things like CI: https://community.ibm.com/zsystems/l1cc/ . But yeah, BE MIPS is super awkward because the target systems are all embedded things that are bad dev/CI machines.
replies(1): >>41859141 #
1. eqvinox ◴[] No.41859141{6}[source]
Stupidly enough, "my" software is a routing control plane (FRRouting), so what I need to support are exactly those embedded things. I'm not sure anyone uses FRRouting on a s390x machine. But maybe we should go ask IBM anyway, a BE system is a BE system…

qemu CPU emulation exists too, but that's painfully slow for an actual CI run, and I'm not sure I trust it enough with e.g. AF_NETLINK translation to use the "-user" variant on top of an LE host rather than booting a full Linux (or even BSD).

And in the very best case, proper testing would pit BE and LE systems "against" each other; if I run tests on BE against itself there's a good risk of mis-encodings on send being mis-decoded back on receive and thus not showing as breakage…

… really, it's just a pain to deal with. Even the beauty (in my eyes) of these T4240 ppc64 systems doesn't bridge that :(