←back to thread

182 points Twirrim | 1 comments | | HN request time: 0s | source
Show context
WalterBright ◴[] No.41875254[source]
D made a great leap forward with the following:

1. bytes are 8 bits

2. shorts are 16 bits

3. ints are 32 bits

4. longs are 64 bits

5. arithmetic is 2's complement

6. IEEE floating point

and a big chunk of wasted time trying to abstract these away and getting it wrong anyway was saved. Millions of people cried out in relief!

Oh, and Unicode was the character set. Not EBCDIC, RADIX-50, etc.

replies(3): >>41875486 #>>41875539 #>>41875878 #
gerdesj ◴[] No.41875486[source]
"1. bytes are 8 bits"

How big is a bit?

replies(6): >>41875621 #>>41875701 #>>41875768 #>>41876060 #>>41876149 #>>41876238 #
poincaredisk ◴[] No.41875621[source]
A bit is either a 0 or 1. A byte is the smallest addressable piece of memory in your architecture.
replies(2): >>41875706 #>>41875737 #
elromulous ◴[] No.41875706[source]
Technically the smallest addressable piece of memory is a word.
replies(2): >>41876026 #>>41876056 #
1. asveikau ◴[] No.41876026[source]
Depends on your definition of addressable.

Lots of CISC architectures allow memory accesses in various units even if they call general-purpose-register-sized quantities "word".

Iirc the C standard specifies that all memory can be accessed via char*.