HN user

coldnose

270 karma
Posts11
Comments50
View on HN

For integer primitives, all possible values are valid. Just allowing binary initialization for structs that consist of integer types would allow compatibility with C structure. As it is, I have to either resort to unsafe code or manually deserialize every struct

I really wish there was a safe way to initialize structs with arbitrary binary data in rust. Perhaps I'm missing something, but it seems intuitively safe, especially if the struct only contains integer primitives.

[dead] 5 years ago

I'm no fan of RMS, but it does seem cruel to oust him for just one of his (innumerable) faux pas.

If anyone's gone through this trouble already, care to explain how you did it? I've been thinking about rolling a VPS with postfix/dovecot, but it seems like such a hassle to maintain, and I'm not super confident in my ability to secure it.

Does anyone else find spicing up ordinary words with new cognates amusing? Super-researchers are ultraconcerned about hyperalarming insect megaloss.

Don't learn Dvorak 8 years ago

I make this same argument all the time. I switched to Dvorak 15 years ago, and though it did vastly improve my typing speed by teaching me to touch-type, I don't know whether it's intrinsically faster. Mostly it's just an impediment now: I can't type on other people's QWERTY keyboards, and other people can't type on mine. For any computer I sit in front of, I have to hunt-and-peck QWERTY keys unless I can switch the layout.

Another example of arbitrary pointer comparison I'm familiar with is for resolving lock ordering problems. If I have a big set of locks that I need to take to complete a particular operation, a simple way to prevent deadlocking is to acquire those locks in the order of their pointers.

E.g. if I have three locks I need to take,

  lock_t *a = (lock_t *)0x100;
  lock_t *b = (lock_t *)0x300;
  lock_t *c = (lock_t *)0x200;
then I'll take them in order a, c, b;