|
|
|
|
|
by lordmauve
2644 days ago
|
|
Please don't use "word" to mean 16 bits. In an era when machine words are generally 64 bits, we're not talking about an anachronism from the previous generation, but the one before that - in a language that is completely insulated from the actual machine architecture. One thing I love about Rust is that it uses u16, u32, u64 etc for unsigned and i16, i32, i64 etc for signed, which is about perfect - clear, concise and future-proof. That would be perfect for this library. https://en.wikipedia.org/wiki/Word_(computer_architecture) |
|
Yes, even good old C has uint16_t and int16_t for this. I use these exclusively for embedded work because we care about the size of everything. Also agree that Rust gets it right by using a single character with the size: u16, i16.
It's funny because C opted to leave the number of bits machine dependent in the name of portability, but that turns out to have the opposite effect.