The Hardest Kind of Unsafe Rust
· 1h 28m
We love Rust for how much the compiler helps enforce safety. But sometimes it's up to us to uphold the complex--and often unclear--expectations of what constitutes safety on our own. Oxide colleague, Rain, joins Bryan and Adam to talk about the technical details of what it takes to impose safety on the hardest type of unsafe Rust. In addition to Bryan Cantrill and Adam Leventhal , we were joined by special guest star, Rain Paharia , Previously on Oxide and Friends: OxF s06e02 - Engineering Rigor in the LLM Age OxF s03e01 - Predictions 2023! Some of the topics we hit on, in the order that we…
Chapters
- Opening banter about Danish pronunciation
- Welcoming Rain back to the show
- IDDQD blog post and Doom cheat codes
- What the IDDQD crate does
- Why IDDQD needs unsafe Rust
- Unsafe code inside the standard library BTreeMap
- Rice's theorem and the compiler's limits
- Rules of writing unsafe Rust
- Origins of the blog post
- The Bun rewrite controversy
- Hardest unsafe Rust with user-authored code
- Reading the Rustonomicon
- Zero-sized types and unsafe code
- IterMut and distinct mutable references
- Fixes and performance tradeoffs
- How the duplicate index bug was found
- Property-based testing and naive implementations
- Panic safety in user code
- LLM-based adversarial review
- Miri, stacked borrows and tree borrows
- Reception of the blog post
- Responsibility in writing unsafe Rust
Speakers
Bryan Cantrill (host), Adam Leventhal (host), Rain Paharia
From the transcript
Is it better? Yeah, I think so. Usually what you say is say more when I say it's better. Like you don't give me... You know what it reminds me of? Do you know anyone who's Danish? Have you ever tried to... pronounce anything in Danish. So…