Live data from Hacker News

Endian wars and anti-portability: this again?

dalmatian.life

21–30 of 73 posts

Re: Endian wars and anti-portability: this again?

#21
post #3

> If the community is offering you a port to an architecture, whether it is 4 days old or 40 years old, that means the community actively wants to use your software on it – otherwise, nobody would put in the effort. Ports like this are hard, and authors like me already know we are fighting an uphill battle just trying to make upstream projects care. I've had plenty of opensource contributions over the years for some…

> What do I do with those reports? Ignore them? Fix the bugs myself? Bleh.

"I don't have access to a test environment, but if you want to write a fix, let me know and I may be able to point you in the right direction" is a perfectly reasonable response.

Re: Endian wars and anti-portability: this again?

#22

Earlier quoted context omitted.

> Little endian is logical and won, big endian is backwards and lost for good reason. No, BE is logical, but LE is efficient (for machines).

No, BE is intuitive for humans who write digits with the highest power on the left. LE is logical which is also why it is more efficient and more intuitive for humans once they get past “how we write numbers with a pencil”.

No, BE is logical because it puts bits and bytes in the same order. That humans use BE is also nice but secondary to that. I don't have strong feelings about whether fifty-one thousand nine hundred sixty-six is written as 0xcafe or 0xefac, but I feel quite comfortable suggesting that 0xfeca is absurd. (FWIW, this is a weak argument for what computers should do; if LE is more efficient for machines then let them use it)

Edit: switched example to hex

Edit2: actually this is still slightly out of whack, but I don't feel like switching to binary so take it as a loose representation rather than literal

Re: Endian wars and anti-portability: this again?

#23

Earlier quoted context omitted.

> Little endian is logical and won, big endian is backwards and lost for good reason. No, BE is logical, but LE is efficient (for machines).

No, BE is intuitive for humans who write digits with the highest power on the left. LE is logical which is also why it is more efficient and more intuitive for humans once they get past “how we write numbers with a pencil”.

> BE is intuitive for humans who write digits with the highest power on the left.

But only because when they dump memory, they start with the lowest address, lol.

Why don't these people reverse numberlines and cartesian coordinate systems while they're at it?

Re: Endian wars and anti-portability: this again?

#24

The glaring omission from that long post is the term "opportunity cost". Ensuring a code base indefinitely supports arbitrary architectures carries a substantial code architecture cost. Furthermore, it is difficult to guarantee testing going forward or that the toolchains available for those architectures will continue to evolve with your code base. I'm old enough to have lived this reality back when it was common. I…

[flagged]

[deleted]

Re: Endian wars and anti-portability: this again?

#25

The glaring omission from that long post is the term "opportunity cost". Ensuring a code base indefinitely supports arbitrary architectures carries a substantial code architecture cost. Furthermore, it is difficult to guarantee testing going forward or that the toolchains available for those architectures will continue to evolve with your code base. I'm old enough to have lived this reality back when it was common. I…

Why not wasm?

Wasm is in an awkward place, because Memory64 is widely but not universally supported. Which means that if you want to support Wasm, you probably have to support 32-bit environments in general. Depending on the project, that can be trivial, but it may also require you to rewrite a lot of low-level code in the project and its dependencies.

Re: Endian wars and anti-portability: this again?

#26
> Big endian systems store numbers the way us humans do: the largest number is written first.

Obviously the author was trying to just give a quick example to aid visualization, but here's some nitpicking: I can probably come up with at least IV writing systems used by humans that don't use "big endian" for numbers. Or either, really.

Examples: Tally marks, Ancient Egyptian numerals, Hebrew and Attic numerals, and obviously Roman numerals.

Also lots languages in written form order words somewhat... randomly (French, Danish, old English, ...).

Re: Endian wars and anti-portability: this again?

#27
> and you refuse a community port to another architecture, you are doing a huge disservice to your community

Someone who has a computer that my software can't run on isn't in my community. If they really want to use the software, they have the option of: 1) get a different computer, or 2) maintain their own custom-special port of my software forever.

In other words, they have to JOIN the community if the want the BENEFITS of the community. It's not my job to extend my community to encompass every possible use case and hardware platform.

Re: Endian wars and anti-portability: this again?

#28

Earlier quoted context omitted.

No, BE is intuitive for humans who write digits with the highest power on the left. LE is logical which is also why it is more efficient and more intuitive for humans once they get past “how we write numbers with a pencil”.

No, BE is logical because it puts bits and bytes in the same order. That humans use BE is also nice but secondary to that. I don't have strong feelings about whether fifty-one thousand nine hundred sixty-six is written as 0xcafe or 0xefac, but I feel quite comfortable suggesting that 0xfeca is absurd. (FWIW, this is a weak argument for what computers should do; if LE is more efficient for machines then let them use i…

Your example is only for dumping memory.

> this is a weak argument for what computers should do; if LE is more efficient for machines then let them use it

Computers really don't care. Literally. Same number of gates either way. But for everything besides dumping it makes sense that the least significant byte and the least significant bit are numbered starting from zero. It makes intuitive mathematical sense.

Re: Endian wars and anti-portability: this again?

#30

Earlier quoted context omitted.

No, BE is intuitive for humans who write digits with the highest power on the left. LE is logical which is also why it is more efficient and more intuitive for humans once they get past “how we write numbers with a pencil”.

No, BE is logical because it puts bits and bytes in the same order. That humans use BE is also nice but secondary to that. I don't have strong feelings about whether fifty-one thousand nine hundred sixty-six is written as 0xcafe or 0xefac, but I feel quite comfortable suggesting that 0xfeca is absurd. (FWIW, this is a weak argument for what computers should do; if LE is more efficient for machines then let them use i…

> No, BE is logical because it puts bits and bytes in the same order.

This sounds confused. The "order" of bits is only an artifact of our human notation, not some inherent order. If you look at how an integer is implemented in hardware (say in a register or in combinational logic), you're not going to find the bits being reversed every byte.

Post reply on HN