<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/rust-and-zig-are-fighting-over-memory-safety-tiehx1b8s" -->

---
title: Rust and Zig are fighting over memory safety | daily.dev
description: Rust's upcoming Polonius borrow checker uses more precise analysis to accept previously-rejected valid programs (like the classic mutable hashmap get_or_insert...
canonical: https://daily.dev/posts/rust-and-zig-are-fighting-over-memory-safety-tiehx1b8s
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Rust and Zig are fighting over memory safety | daily.dev
og:description: Rust's upcoming Polonius borrow checker uses more precise analysis to accept previously-rejected valid programs (like the classic mutable hashmap get_or_insert...
og:url: https://daily.dev/posts/rust-and-zig-are-fighting-over-memory-safety-tiehx1b8s
og:image: https://api.daily.dev/og/posts/tIEhx1B8s.png
og:image:alt: Rust and Zig are fighting over memory safety
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Rust and Zig are fighting over memory safety

**[Awesome](https://daily.dev/sources/awesome-coding)** · 9 min read · 5 upvotes · 1 comments

## Summary

Rust's upcoming Polonius borrow checker uses more precise analysis to accept previously-rejected valid programs (like the classic mutable hashmap get_or_insert pattern), at a roughly 2% compile-time cost across the top 10,000 crates. Meanwhile Zig is debating a proposed optional memory-safe compilation mode inspired by PhilC, which would dynamically enforce memory safety across a whole program including C/C++ dependencies using capability metadata and garbage collection, at the cost of 1x-6x slowdowns and a specialized runtime. The piece frames this as two opposite philosophies: Rust spends compiler complexity and developer effort upfront for static guarantees, while Zig's proposal would spend CPU cycles at runtime instead.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.youtube.com/watch?v=7H--tn8RLSc>

## Questions this post answers

### What is Polonius in Rust and what problem does it fix in the borrow checker?

Polonius is a new, more precise borrow-checker analysis for Rust that tracks where individual loans are actually active rather than treating a borrow as alive for its whole lexical scope. This fixes cases like the get_or_insert pattern on a mutable hashmap, where the old checker wrongly rejected valid code because it assumed the first mutable borrow was still alive when a second mutable borrow occurred in a different branch.

_Developers tracking Rust compiler internals can follow borrow-checker changes like this one on daily.dev._

### How much slower does the compile time get with Rust's new Polonius borrow checker?

Testing across the 10,000 most popular Rust crates showed an average compile-time regression of around 2% with the new Polonius analysis enabled. This is considered an acceptable trade-off since Polonius allows more valid, memory-safe programs to compile successfully instead of being incorrectly rejected by the older borrow-checker logic.

_Anyone weighing Rust compiler upgrades can keep an eye on performance trade-offs like this via daily.dev._

### What is Zig's proposed memory-safe compilation mode inspired by Philc and how much slower would it make programs?

Zig's community is considering an optional compilation mode, inspired by Philc, that would dynamically check pointer operations across an entire program including its C and C++ dependencies, using capability-tagged pointers and a concurrent garbage collector instead of a borrow checker. Invalid accesses would panic rather than corrupt memory, but the approach could make programs one to six times slower depending on how pointer-heavy the code is.

_Developers deciding between Zig's runtime safety trade-offs and Rust's compile-time model can track proposals like this on daily.dev._

## Community discussion

Top comments from developers on daily.dev.

**@bangursis** · 1 upvotes

> I like the guy, but he missed the point, that zig's approach would work with the test/debug mode, not the release one

## Similar posts on daily.dev

- [Zig vs Rust in 2026](https://daily.dev/posts/zig-vs-rust-in-2026-hhp61o6ff) · Lobsters · 68 upvotes · 4 comments
- [Memory Safety Absolutists](https://daily.dev/posts/memory-safety-absolutists-sufigv3zl) · Hacker News · 1 upvotes · 0 comments

---

Tags: [#rust](https://daily.dev/tags/rust), [#zig](https://daily.dev/tags/zig)

[View this post on daily.dev](https://daily.dev/posts/rust-and-zig-are-fighting-over-memory-safety-tiehx1b8s)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Rust and Zig are fighting over memory safety","url":"https://daily.dev/posts/rust-and-zig-are-fighting-over-memory-safety-tiehx1b8s","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/rust-and-zig-are-fighting-over-memory-safety-tiehx1b8s"},"datePublished":"2026-08-12T10:13:36.092Z","dateModified":"2026-09-14T07:41:49.636Z","description":"Rust's upcoming Polonius borrow checker uses more precise analysis to accept previously-rejected valid programs (like the classic mutable hashmap get_or_insert...","image":"https://i.ytimg.com/vi/7H--tn8RLSc/sddefault.jpg","thumbnailUrl":"https://i.ytimg.com/vi/7H--tn8RLSc/sddefault.jpg","isAccessibleForFree":true,"articleSection":"Awesome","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Awesome","logo":"https://media.daily.dev/image/upload/s--mj_0cdD8--/f_auto/v1710506099/logos/awesome-coding","url":"https://daily.dev/sources/awesome-coding"},"commentCount":1,"discussionUrl":"https://daily.dev/posts/rust-and-zig-are-fighting-over-memory-safety-tiehx1b8s","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":5},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":1}],"keywords":"rust,zig","timeRequired":"PT9M","video":{"@type":"VideoObject","name":"Rust and Zig are fighting over memory safety","description":"Rust's upcoming Polonius borrow checker uses more precise analysis to accept previously-rejected valid programs (like the classic mutable hashmap get_or_insert...","thumbnailUrl":"https://i.ytimg.com/vi/7H--tn8RLSc/sddefault.jpg","uploadDate":"2026-08-12T10:13:36.092Z","duration":"PT9M","url":"https://api.daily.dev/r/tIEhx1B8s","embedUrl":"https://www.youtube.com/embed/7H--tn8RLSc"}}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Awesome","item":"https://daily.dev/sources/awesome-coding"},{"@type":"ListItem","position":3,"name":"Rust and Zig are fighting over memory safety"}]}
{"@context":"https://schema.org","@type":"WebPage","@id":"https://daily.dev/posts/rust-and-zig-are-fighting-over-memory-safety-tiehx1b8s","comment":[{"@type":"Comment","text":"I like the guy, but he missed the point, that zig’s approach would work with the test/debug mode, not the release one","datePublished":"2026-08-12T12:27:57.931Z","url":"https://daily.dev/posts/tIEhx1B8s#c-txLli48kD","author":{"@type":"Person","name":"Arthur","url":"https://daily.dev/bangursis","image":"https://media.daily.dev/image/upload/s--zxHa8Jbn--/f_auto/v1756385859/avatars/avatar_8cefb1381e76492fb74972498d0615c5?_a=BAMClqZW0"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":1}}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/rust-and-zig-are-fighting-over-memory-safety-tiehx1b8s#faq","mainEntity":[{"@type":"Question","name":"What is Polonius in Rust and what problem does it fix in the borrow checker?","acceptedAnswer":{"@type":"Answer","text":"Polonius is a new, more precise borrow-checker analysis for Rust that tracks where individual loans are actually active rather than treating a borrow as alive for its whole lexical scope. This fixes cases like the get_or_insert pattern on a mutable hashmap, where the old checker wrongly rejected valid code because it assumed the first mutable borrow was still alive when a second mutable borrow occurred in a different branch. Developers tracking Rust compiler internals can follow borrow-checker changes like this one on daily.dev."}},{"@type":"Question","name":"How much slower does the compile time get with Rust's new Polonius borrow checker?","acceptedAnswer":{"@type":"Answer","text":"Testing across the 10,000 most popular Rust crates showed an average compile-time regression of around 2% with the new Polonius analysis enabled. This is considered an acceptable trade-off since Polonius allows more valid, memory-safe programs to compile successfully instead of being incorrectly rejected by the older borrow-checker logic. Anyone weighing Rust compiler upgrades can keep an eye on performance trade-offs like this via daily.dev."}},{"@type":"Question","name":"What is Zig's proposed memory-safe compilation mode inspired by Philc and how much slower would it make programs?","acceptedAnswer":{"@type":"Answer","text":"Zig's community is considering an optional compilation mode, inspired by Philc, that would dynamically check pointer operations across an entire program including its C and C++ dependencies, using capability-tagged pointers and a concurrent garbage collector instead of a borrow checker. Invalid accesses would panic rather than corrupt memory, but the approach could make programs one to six times slower depending on how pointer-heavy the code is. Developers deciding between Zig's runtime safety trade-offs and Rust's compile-time model can track proposals like this on daily.dev."}}]}
```

