News for hackers. Stuff that matters.
Re:Teaching D from Scratch: Is it a viable first language? by chriswarbo on Thursday December 30, 2021 @01:58AM (#29734379)
I like the distinction made by Haskell:

- A Byte (AKA Word8) is 8 bits. It has no inherent meaning.

- A Character (AKA Char) is a Unicode code point.

- A ByteString is a sequence of Bytes. It has no inherent meaning.

- A Text (AKA String) is a sequence of Chars.

In particular, Char != Byte and String != ByteString; we can juggle bytes without having to care about encodings; and we can manipulate text without having to care about its representation.

Re:Teaching D from Scratch: Is it a viable first language? by dmkolobov on Thursday December 30, 2021 @02:08PM (#29740154)
Definitely appreciate how careful Haskell is about the distinction: it's where I first started having these thoughts!