4 ms·
There's an option of making char 64-bit, in which case you can always use char* So that sizeof(int) = sizeof(float) = sizeof(char) = 1
by thriftwy 5y ago
There's an option of making char 64-bit, in which case you can always use char*
So that sizeof(int) = sizeof(float) = sizeof(char) = 1
- selfhoster11 5y agoThat's how we ended up with UTF-16, the abomination from Microsoft. UTF-8 or bust.
- AnIdiotOnTheNet 5y agoMicrosoft did not invent UTF-16 (which in fact is just a retcon of UCS2), they were just early adopters of Unicode and UTF-8 didn't exist yet.
- selfhoster11 5y agoThey might not have invented it, but they popularised it. UTF-16 would be dead and a footnote in history if it hadn't been for Microsoft's adoption of it.
- fomine3 5y agoUTF-8 is appeared a bit late at the time Unicode being adopted initially. So WinNT and other projects like Java also adopts UCS-2.
- account42 5y ago1. sizeof(int) and sizeof(float) are both 32-bit on most current systems 2. Unicode is (currently) only 21-bit. 3. UCS-4 (aka 32-bit char) rarely helps because in most cases you either a) don't really care about characters (most software) and can use substrings as well or b) code points are an insufficient grouping and you need variable length units anyway for grapheme clusers (text rendering and editing).
- thriftwy 5y ago1. They will also be one 64-bit memory word. 2. So we have plenty of room. 3. So it does not hurt.
- CyberDildonics 5y agoI think you have some large misconceptions about these things. sizeof(float) is going to return 4 for 4 bytes on any common computer these days. There is no "64-bit memory word" anywhere to be found, whatever that means. Nothing in either of your comments here is true or makes sense.
- thriftwy 5y ago"Common computer these days" will eventually have to go. And it probably will be much sooner than trans-Earth English language dominion.
- CyberDildonics 5y agoI expected more of a "I guess I misunderstood how C works" sort of reply.
- thriftwy 5y agoI began coding in 1994. I'm still basic in C, but not that basic. 8-bit byte will eventually have to go.
- CyberDildonics 5y agoWill that be before or after the trans-Earth English language dominion?