# The Hardest Kind of Unsafe Rust

- Show: [Oxide and Friends](https://hardwarepodcasts.com/podcast/oxide-and-friends)
- Published: 2026-06-13
- Length: 1h 28m
- Episode: 14
- Page: https://hardwarepodcasts.com/podcast/oxide-and-friends/2026-06-13-the-hardest-kind-of-unsafe-rust
- Listen: https://share.transistor.fm/s/8e79bc4b

## Summary

Rain Paharia, an engineer at Oxide Computer Company, joins Bryan Cantrill and Adam Leventhal to discuss the `iddqd` Rust crate, which allows keys to be borrowed from values in maps to avoid duplication. Paharia explains that implementing this efficiently requires 'unsafe Rust,' specifically dealing with the 'hardest kind' where the library must remain sound even when user-provided code behaves pathologically or incorrectly. The conversation details how Paharia used property-based testing, Miri, and LLMs to find and fix bugs related to mutable aliasing and panic safety in the crate. The discussion highlights the rigorous responsibility required when writing unsafe code that interacts with untrusted or buggy safe code.

## Chapters

- [0:00](https://hardwarepodcasts.com/podcast/oxide-and-friends/2026-06-13-the-hardest-kind-of-unsafe-rust#t=0) Introduction: Audio issues and Rain Paharia's return
- [6:37](https://hardwarepodcasts.com/podcast/oxide-and-friends/2026-06-13-the-hardest-kind-of-unsafe-rust#t=397) The iddqd crate: Borrowing keys from values in Rust maps
- [12:27](https://hardwarepodcasts.com/podcast/oxide-and-friends/2026-06-13-the-hardest-kind-of-unsafe-rust#t=747) Why iddqd requires unsafe Rust and Rice's Theorem
- [19:17](https://hardwarepodcasts.com/podcast/oxide-and-friends/2026-06-13-the-hardest-kind-of-unsafe-rust#t=1157) History of unsafe: Haskell, C, and Rust's unique position
- [32:03](https://hardwarepodcasts.com/podcast/oxide-and-friends/2026-06-13-the-hardest-kind-of-unsafe-rust#t=1923) The Bun rewrite in Rust and the cost of casual unsafe code
- [39:51](https://hardwarepodcasts.com/podcast/oxide-and-friends/2026-06-13-the-hardest-kind-of-unsafe-rust#t=2391) Handling pathological user code and the infosec mindset
- [55:34](https://hardwarepodcasts.com/podcast/oxide-and-friends/2026-06-13-the-hardest-kind-of-unsafe-rust#t=3334) Fixing bugs: Linear scans and handling duplicate indexes
- [1:03:57](https://hardwarepodcasts.com/podcast/oxide-and-friends/2026-06-13-the-hardest-kind-of-unsafe-rust#t=3837) Validation techniques: Naive implementations and property-based testing
- [1:07:07](https://hardwarepodcasts.com/podcast/oxide-and-friends/2026-06-13-the-hardest-kind-of-unsafe-rust#t=4027) Panic safety and adversarial testing with LLMs and Miri
- [1:20:20](https://hardwarepodcasts.com/podcast/oxide-and-friends/2026-06-13-the-hardest-kind-of-unsafe-rust#t=4820) Reception of the blog post and the responsibility of unsafe Rust

## Topics

- [Embedded firmware](https://hardwarepodcasts.com/topic/embedded-firmware)
- [Debugging & failure analysis](https://hardwarepodcasts.com/topic/debugging-and-failure-analysis)
- [AI & machine learning](https://hardwarepodcasts.com/topic/ai-and-machine-learning)
- [PCB design & layout](https://hardwarepodcasts.com/topic/pcb-design)
- [Microcontrollers & dev platforms](https://hardwarepodcasts.com/topic/microcontrollers-and-platforms)

## Most relevant to

early-stage companies

## Mentioned

- Oxide Computer Company (company)
- Rain Paharia (other)
- Bryan Cantrill (other)
- Adam Leventhal (other)
- iddqd (other)
- Omicron (product)
- CockroachDB (product)
- John Gallagher (other)
- Miri (tool)
- Claude Opus 4.7 (other)
- GPT 5.5 (other)
- Bun (product)
- Zig (other)
- Rust (other)
- Haskell (other)
- C (other)
- LLVM (other)
- Ben Leonard (other)
- Ericsson (company)
- Google (company)
- ChatGPT (other)
- Doom (product)
- Castle Wolfenstein (product)
- Battlefield (product)
- DTrace (product)
- MITRE (company)
- Angela Lee Brinker (other)
- Sebastian (other)
- Dan Cross (other)
- Ixie (other)
- Robert Ledru (other)
- Donald Sobel (other)
- Strange But True (other)
- Rustnomicon (other)
- POPL (other)
- PLDI (other)
- Ralph Young (other)
- BTreeMap (other)
- HashMap (other)
- Vec (other)
- splitter_mut (other)
- iter_mut (other)
- org (other)
- thread_local (other)
- stacked borrows (other)
- tree borrows (other)
- mid level intermediate representation (other)
- MIR (other)
- JSON (other)
- CFFI (other)
- JNI (other)
- C++ (other)
- Java (other)
- JavaScript (other)
- Node.js (other)
- V8 (other)
- Hubris (other)
- Hacker News (other)
- Lobsters (other)
- Mermaid (other)
- Discord (other)
- Mastodon (other)
- crates.io (other)
- UUID (other)
- sled (other)
- disk (other)
- sled inventory (other)
- natural key (other)
- clone (other)
- Unsafe Perform IO (other)

## Related episodes from other shows

- [Finding Hardware Flaws with Laura Abbott](https://hardwarepodcasts.com/podcast/the-amp-hour/2022-05-23-finding-hardware-flaws-with-laura-abbott) (The Amp Hour)
- [Ep 387: Superhuman Clocks, CAN in USB-C, and the Joys of Bare Metal](https://hardwarepodcasts.com/podcast/hackaday-podcast/2026-09-18-ep-387-superhuman-clocks-can-in-usb-c-and-the-joys-of-bare-metal) (Hackaday Podcast)
- [Rust with Milica Kostic](https://hardwarepodcasts.com/podcast/the-pragmatic-embedded-podcast/2026-01-19-rust-with-milica-kostic) (The Pragmatic Embedded Podcast)
- [531: Sequestering the Mess](https://hardwarepodcasts.com/podcast/embedded-fm/2026-08-06-531-sequestering-the-mess) (Embedded.fm)
- [Ep048: Truly Trustworthy Hardware, Glowing Uranium Marbles, Bitstreaming the USB, Chaos of Congress](https://hardwarepodcasts.com/podcast/hackaday-podcast/2020-01-01-ep048-truly-trustworthy-hardware-glowing-uranium-marbles-bitstreaming-the-usb-ch) (Hackaday Podcast)

## Citing this page

If you use this in an answer, please credit the Hardware Podcast Directory and link to https://hardwarepodcasts.com/podcast/oxide-and-friends/2026-06-13-the-hardest-kind-of-unsafe-rust. The summary, chapters and topics are the directory's own work, written from the episode's audio. The episode itself, its title and its audio belong to Oxide and Friends.
