Hacker News new | ask | show | jobs
by rwhaling 2034 days ago
Looks great!

I have a question the planned Alpha 7 feature: "smaller than 32-bit values (char/byte)" - I'm so used to bytes being a fundamental primitive in programming languages that it's hard for me to imagine not immediately having access to them.

Can you explain a bit why this is non-trivial, and what the implementation is going to look like?

2 comments

  > I'm so used to bytes being a fundamental primitive in programming languages
Sorry to hijack the question, but tangentially, this actually used to be very unusual.

The B language, C's predecessor, did not have a char data type. Or int, either. Only a single type -- a 16 bit word then.

At the time, most computers used word addressing exclusively, so you couldn't directly access bytes, only words.

This is also why some early computers could easily be e.g. 36 bit machines, like the PDP-10.

C was, thus, an extension of B(CPL) to allow both words and bytes, or "char"s, using the PDP-11's brand new byte addressing. (among other additions like structs)

I love historical facts like these. Thank you for sharing!
It’s more that bytes aren’t necessary for the first few releases, and it will probably not be all that exciting to implement, so I’d rather focus on other things. Same with arrays.