The compiler continues to amaze me.

I've been writing a multi-threaded app that interfaces with other C libs. And so many times now, I've wanted to write my inter-thread communication in a certain way, and rusc often tells me no.

And when I think about the communication some more, rustc is usually right! And then I change my design to make rustc happy, and that bug goes away.


Although, sometimes I really know more than rustc does. Especially when I'm reasoning about the C libs I'm using. For those cases, I'm allowed to break the rules and be "unsafe".

But the coolest part is I only have to be "unsafe" when I really need it. And since rustc makes me think twice as hard about "unsafe" code, I think I'm less likely to get it wrong in those cases.

Sign in to participate in the conversation
Mastodon for Tech Folks

The social network of the future: No ads, no corporate surveillance, ethical design, and decentralization! Own your data with Mastodon!