Comment by teravor
17 hours ago
right, so a zig app will just do little endian. in the very unlikely event you have it running on a big endian machine you have to do extra work.
17 hours ago
right, so a zig app will just do little endian. in the very unlikely event you have it running on a big endian machine you have to do extra work.
You may have never done socket programming, or do you use wrapper libs in Zig? Because you have to send the kernel big endian port numbers for example.
What do you do if you program a kernel in Zig, or just generally do low level networking?
My point is to refute the statement that everyone has agreed to little endian, and so there aren't use cases to want to do conversion. Programs do not exist in a vacuum, most programs do not.
Well you would, of course, have a mapping layer between wire types and domain types, like in any good codebase. You do the endianness conversion at that boundary, and then you can just send it out.
> You do the endianness conversion
Exactly my point.
And what happens if your zig app happens to be a network driver running on a microcontroller?