Live data from Hacker News

C++ proposal: There are exactly 8 bits in a byte

open-std.org

31–40 of 357 posts

Re: C++ proposal: There are exactly 8 bits in a byte

#32
post #9

Earlier quoted context omitted.

"Word" is an outdated concept we should try to get rid of.

It's very useful on hardware that is not an x86 CPU.

As an abstraction on the size of a CPU register, it really turned out to be more confusing than useful.

Re: C++ proposal: There are exactly 8 bits in a byte

#34
post #9

Earlier quoted context omitted.

"Word" is an outdated concept we should try to get rid of.

You're right. To be consistent with bytes we should call it a snack .

Henceforth, it follows that a doublesnack is called a lunch. And a quadruplesnack a fourthmeal.

Re: C++ proposal: There are exactly 8 bits in a byte

#35
post #17

the fact that this isn't already done after all these years is one of the reasons why I no longer use C/C++. it takes years and years to get anything done, even the tiniest, most obvious drama free changes. contrast with Go, which has had this since version 1, in 2012: https://pkg.go.dev/builtin@go1#byte

[deleted]

Re: C++ proposal: There are exactly 8 bits in a byte

#36
Ignoring this C++ proposal, especially because C and C++ seem like a complete nightmare when it comes to this stuff, I've almost gotten into the habit of treating a "byte" as a conceptual concept. Many serial protocols will often define a "byte", and it might be 7, 8, 9, 11, 12, or whatever bits long.

Re: C++ proposal: There are exactly 8 bits in a byte

#37

I wish I knew what a 9 bit byte means. One fun fact I found the other day: ASCII is 7 bits, but when it was used with punch cards there was an 8th bit to make sure you didn't punch the wrong number of holes. https://rabbit.eng.miami.edu/info/ascii.html

A 9-bit byte is found on 36-bit machines in quarter-word mode.

Parity is for paper tape, not punched cards. Paper tape parity was never standardized. Nor was parity for 8-bit ASCII communications. Which is why there were devices with settings for EVEN, ODD, ZERO, and ONE for the 8th bit.

Punched cards have their very own encodings, only of historical interest.

Re: C++ proposal: There are exactly 8 bits in a byte

#38
post #9

Earlier quoted context omitted.

"Word" is an outdated concept we should try to get rid of.

How exactly ? How else do you suggest CPUs do addressing ? Or are you suggesting to increase the size of a byte until it's the same size as a word, and merge both concepts ?

I'm saying the term "Word" abstracting the number of bytes a CPU can process in a single operation is an outdated concept. We don't really talk about word-sized values anymore. Instead we mostly explicit on the size of value in bits. Even the idea of a CPU having just one relevant word size is a bit outdated.

Re: C++ proposal: There are exactly 8 bits in a byte

#39
I'm totally fine with enforcing that int8_t == char == 8-bits, however I'm not sure about spreading the misconception that a byte is 8-bits. A byte with 8-bits is called an octet.

At the same time, a `byte` is already an "alias" for `char` since C++17 anyway[1].

[1] https://en.cppreference.com/w/cpp/types/byte

Post reply on HN