Porting

Zig & Rust, incrementally

How we are moving critical paths from C++ to Zig and Rust. We are not throwing away Chromium overnight — we are replacing the riskiest and most isolated pieces first, starting with code that already lives in Rust.

Now

  • Vendor Chromium, Brave, and adblock-rust in one tree
  • Map ownership boundaries: C++, Rust, and experimental Zig
  • Extend Rust where it already ships (adblock, selected Brave modules)

Next

  • Isolate FFI seams between C++ and new Rust/Zig modules
  • Port leaf subsystems with clear interfaces (parsers, utilities, sandboxes)
  • Measure binary size, latency, and build-time impact per migration

Later

  • Reduce C++ surface in hot paths without breaking Chromium compatibility
  • Document every upstream divergence for easier rebases
  • Ship a browser that is faster to audit and safer by construction

Why not rewrite everything at once?

Chromium is one of the largest C++ codebases on Earth. A clean-slate rewrite would take years and stall on web compatibility. Our approach treats the existing tree as the source of truth while we carve out modules that can move to Zig or Rust without destabilizing the engine.

Where Rust already wins

Brave's adblock-rust proves the model: native performance, strong typing, and a small FFI boundary into the browser. We extend that pattern to other subsystems with similar isolation.

Where Zig fits

Zig offers explicit allocators, comptime, and first-class C interop — useful for new modules and selected rewrites where we want C ABI compatibility without C++ baggage. Experiments live under brave_rewrite/ in the main repository.