rust-lang / nomicon

The Dark Arts of Advanced and Unsafe Rust Programming
https://doc.rust-lang.org/nomicon/
Apache License 2.0
1.74k stars 256 forks source link

What does "frob some dang bits" mean in chapter `Meet Safe and Unsafe`? #416

Closed Sunshine40 closed 12 months ago

Sunshine40 commented 12 months ago

But maybe you want to talk to another language. Maybe you're writing a low-level abstraction not exposed by the standard library. Maybe you're writing the standard library (which is written entirely in Rust). Maybe you need to do something the type-system doesn't understand and just frob some dang bits. Maybe you need Unsafe Rust.

Could anyone explain what "Maybe you need to do something the type-system doesn't understand and just frob some dang bits" means in this context please? English is not my first language.

ehuss commented 12 months ago

It is slang which loosely means to directly modify or tweak some bits in memory. "dang" is used for emphasis giving a slight hint of anger (an attempt at a slightly more polite euphemism for "damn").

Sunshine40 commented 12 months ago

It is slang which loosely means to directly modify or tweak some bits in memory. "dang" is used for emphasis giving a slight hint of anger (an attempt at a slightly more polite euphemism for "damn").

Okay, then it is:

  1. Maybe you need to a) [do something the type-system doesn't understand] and b) [just frob some dang bits]

not:

  1. Maybe you need to do something the type-system [ a) doesn't understand and b) just frob some dang bits ]

I previously thought it was case 2, so I did misunderstand.

The original translator of the book didn't understand that phrase either.