Skip to content
Proyek

kevincouton/awesome-rust-migrations

Lihat di GitHub

Tentang

The curated hub for migrating to Rust and eliminating memory-safety vulnerabilities: AI-assisted rewrites, C2Rust case studies, production adoptions at scale, interop tooling, and the evidence behind it. Originally based on malisper/awesome-ai-rust-rewrites (CC0).

Keamanan dan privasi

Cara angka ini diukur

Pertumbuhan bintang terukur

dalam 24 jam
0
dalam 7 hari
0
dalam 15 hari
0
dalam 1 bulan
+3

Perubahan bersih pada periode yang tumpang tindih, bukan total harian. Pengukuran yang belum tersedia dibiarkan kosong. Bintang menunjukkan perhatian, bukan kualitas.

README.md

Asli

Awesome Rust Migrations Awesome

Migrating existing codebases to Rust — and eliminating memory-safety vulnerabilities at the source.

Rewriting C, C++, and other legacy code in Rust is now a serious, funded, engineering discipline: Google is rewriting dependencies with AI assistance, CISA and the NSA tell vendors to publish memory-safe roadmaps, and DARPA is paying to translate all of C. This list tracks the evidence, the rewrites, the tools, and the research.

Contents

The Evidence

The data and policy behind the migration movement. Memory safety bugs are the majority of serious vulnerabilities in C and C++ codebases, and Rust measurably eliminates them.

  • Scaling Memory Safety: AI-Assisted Rewrites of C/C++ Dependencies to Rust - Google's pilot using Gemini to rewrite C/C++ dependencies such as giflib into Rust, with the process, verification, and lessons from scaling AI-assisted translation.
  • Gemini 4 Argon: our next era of frontier intelligence - Google's September 2026 announcement scaling the giflib pilot to company-wide migration: Argon agents port C/C++ codebases to Rust from tens of thousands of lines in re2 and libgav1 up to 800K+ lines for the Fuchsia Zircon kernel, under automated and manual auditing and emulation testing; for libgav1, agents replaced 32K lines of hand-written SIMD with auto-vectorizing safe Rust, 2.7x faster than the previous Rust port with identical video output.
  • Rust in Android: move fast and fix things - 2025 update: Android memory-safety vulnerabilities fell below 20% of the total for the first time, with Rust code showing roughly 1000x lower memory-safety vulnerability density than C and C++ code.
  • Eliminating memory safety vulnerabilities at the source - Google Security Blog analysis of why new safe code beats rewriting old code, and how Android's strategy turns off the tap of new memory-unsafe code.
  • Chromium: Memory safety - The Chromium project's canonical page: roughly 70% of serious security bugs are memory safety issues, and the plan to address them, including Rust.
  • The Case for Memory Safe Roadmaps - Joint guidance from CISA, NSA, FBI, and international partners urging every technology manufacturer to publish a memory-safe roadmap and describe how memory-unsafe dependencies will be eliminated.
  • Software Memory Safety Is Cybersecurity - CISA advisory AA23-352A on memory safety as a national cybersecurity concern, with language-by-language migration recommendations.
  • Memory Safe Languages: Reducing Vulnerabilities in Modern Software Development - Joint NSA and CISA Cybersecurity Information Sheet (2024) on adopting memory-safe languages, expanding on NSA's original Software Memory Safety guidance and the White House ONCD "Back to the Building Blocks" report.
  • Prossimo: Memory Safety - Internet Security Research Group initiative funding memory-safe rewrites and foundations, including rav1d, rustls, zlib-rs, and Rust support in the Linux kernel.
  • Sovereign Tech Agency Resilience Program, with Tweedegolf - A multi-year funded program contracting the sudo-rs/zlib-rs team to assess, plan, and execute C/C++-to-Rust transitions for critical FOSS projects free of charge, with maintainers staying in the lead.
  • Rust Is Tier-1 Language at Microsoft - Rust Foundation guest post by Microsoft's Rust tooling lead: Rust now sits alongside C++, C#, and TypeScript as a Tier-1 internal language at Microsoft, backed by rustc_codegen_utc, an MSVC-native code-generation backend already building 100+ internal projects and enabling deep Rust/C++ interop.
  • Rust in the Linux kernel, by the numbers - Living dataset counting Rust lines of code, share of unsafe, and calls into C for every kernel release from v6.1 through v7.4-rc2, tracking the migration's actual footprint in the kernel tree.
  • Introducing CUDA Rust: Two Tracks for Writing GPU Kernels - NVIDIA's September 2026 announcement of native Rust GPU kernels compiled to PTX (cuda-oxide for SIMT, cutile-rs for tiles), where aliasing and out-of-bounds errors fail at compile time; the Nova Linux driver is already written in Rust.
  • systemd ❤️ Rust - Maintainers Christian Brauner and Lennart Poettering announce merged support for Rust in systemd: leaf binaries first (no-std Rust, fallible allocations, uniform meson build) while the shared library stays C, explicitly aiming at Rust in core components once first-class shared-library support lands.
  • DARPA TRACTOR - DARPA program to automate translation of legacy C code to Rust using software analysis and machine learning.
  • TRACTOR Benchmarks - MIT Lincoln Laboratory benchmarks and evaluation work for DARPA's C-to-Rust translation program.

AI-Assisted Rewrites

Projects pushing the limits of AI-assisted rewrites into Rust, where behavior compatibility and test suites are the bar.

  • Anthropic Messages API Python-to-Rust rewrite - Claude-assisted port of the production Messages API, using the evolving Python service as a behavioral oracle, privacy-preserving diff checkpoints and fingerprints, replayed model outputs, and human-reviewed shadow-traffic repair loops; Anthropic reports about 70% less CPU per request and about 20% lower median time to first token for Claude Code, without downtime or a feature freeze.
  • arXiv/NIST LaTeXML Perl-to-Rust port - Ongoing reimplementation with approaching 100K agent-added lines on top of roughly 50K handwritten Rust lines, all core tests passing and engineering parity on the first few hundred arXiv articles; early matched-input benchmarks report 10-30x speedups, while production remains on Perl pending confidence in a switchover.
  • Bun Zig-to-Rust rewrite - Bun merged "Rewrite Bun in Rust" on May 14, 2026 from the claude/phase-a-port branch, adding a Rust workspace across thousands of files; Bun canary builds are released from every main commit via bun upgrade --canary.
  • GitHub Copilot agent runtime TypeScript-to-Rust rewrite - Copilot agents ported the runtime to 832,378 lines of production Rust across 128 pull requests, retaining 174,675 lines of TypeScript end-to-end tests plus cross-language SDK suites; incremental releases, candid regression analysis, and an approximately $120K token bill document both validation and cost.
  • Grit - GitButler's AI-authored Git reimplementation in Rust, targeting close behavior compatibility with upstream Git by porting and running the Git test suite against grit-git.
  • Ladybird's Rust adoption - Browser project adopting Rust with AI assistance, starting with LibJS because it is relatively isolated and has extensive test coverage.
  • Microsoft — Cheap code, precious trust - Microsoft's October 2026 account of agent-driven C/C++-to-Rust modernization: feature-by-feature migration, differential and held-out tests, and formal specifications checked with Verus.
  • pacquet - Official pnpm rewrite in Rust, matching pnpm behavior, flags, defaults, error codes, file formats, and directory layout; shipped as pnpm 12, stable since August 2026 with the documentation defaulting to it and project benchmarks showing warm repeat installs down from 472 ms to 15 ms.
  • pgrust - PostgreSQL rewrite in Rust using AI-assisted engineering, with PostgreSQL behavior and compatibility tests as the bar.
  • OpenAI Habitat Python-to-Rust rewrite - OpenAI rewrote its Habitat storage service from Python to Rust in Q2 2026 with two engineers plus Codex and GPT-5.5; the Rust service now handles 95% of production requests (over 20M requests per second at the Python version's peak), with 6x CPU and 15x memory efficiency.
  • tsz - AI-assisted Rust implementation of a TypeScript checker targeting drop-in tsc compatibility, with conformance progress reported against the official TypeScript test suite.
  • OpenCode Browse Node-to-Rust rewrite - OpenCode's browser-automation relay rewritten from Node and Playwright to Rust for $60 in model credits: a 4.3 MB binary versus 53-64 MB, per-connector memory down about 97% (190 MB to 5.6 MB), validated with two rounds of regression testing across roughly ten agents, at the cost of owning browser-compatibility maintenance.

Automated Translation and C2Rust Case Studies

These are mostly not AI-assisted, but they are the prior art for automated translation, cleanup, safety work, and compatibility.

  • libbzip2-rs - Drop-in compatible Rust implementation of bzip2 created with C2Rust and later used by the bzip2 crate.
  • libyaml-safer - Fully safe Rust fork of unsafe-libyaml, originally translated from libyaml with C2Rust.
  • rav1d - Fully safe Rust port of the dav1d AV1 decoder, created with C2Rust and then refactored toward safer, more idiomatic Rust.
  • rexpat - Rust port of Expat used as a C2Rust case study.
  • sapp-kms - C2Rust-derived port of sokol's KMS backend, cleaned up but still unsafe.
  • spiro.rlib - Fully safe C2Rust-derived port of the spiro spline interpolation library.
  • tsuki - Fully safe C2Rust-derived port of the Lua interpreter.
  • unsafe-libyaml - Mostly direct C2Rust-derived port of libyaml, kept fully unsafe with minor cleanup.
  • zlib-rs - Rust implementation of zlib exposed as both a C dynamic library and a Rust crate.

Production Adoptions at Scale

Not necessarily AI-assisted — these show large production systems replacing services and infrastructure with Rust implementations.

  • Cloudflare FL2 front line - Cloudflare rebuilt the 15-year-old Front Line proxy in front of roughly 20% of the internet from NGINX/OpenResty and Lua (FL1) into Rust (FL2), using an adapter layer to run Rust modules inside the old system first and the Flamingo automated test framework to prove parity during the cutover.
  • Android Binder C driver removal - The C implementation of Android's Binder IPC driver was deleted from the kernel, announced at Kangrejos 2026 after five years replacing it with Alice Ryhl's Rust implementation; Greg Kroah-Hartman notes slow vendor kernel updates mean the field verdict will take months or years.
  • Proton mobile apps Rust core - Proton rewrote the mobile tech stack of Proton Mail v7 around a shared Rust core, so Android and iOS now share roughly 80% of their code; ProtonPass and ProtonAuthenticator are also built on common Rust cores published on GitHub.
  • Discord Read States Go-to-Rust rewrite - Discord's writeup of rewriting the Read States service from Go to Rust after garbage-collector spikes caused latency problems; the canonical account of what problems Rust actually solves and what it costs in ecosystem maturity.
  • Discord Phoenix client rewrite - Discord's CTO confirmed the desktop client is being rebuilt in Rust on Zed's GPUI framework, replacing Electron, with mobile following off React Native onto native UI plus a shared Rust core; an early Windows build idles at 290 MB of RAM (two accounts signed in) against the Electron client's typical 1-4 GB.
  • Shipping JPEG XL in Chrome - Chrome 155 ships JPEG XL decoding via jxl-rs, a safety-first Rust reimplementation replacing the roughly 100,000-line multithreaded C++ reference decoder; Mozilla made a Rust decoder its condition for Firefox adoption, so every major engine gets the memory-safe path.
  • Rust for CPython (Python Language Summit 2026) - Official status update on bringing Rust into the CPython interpreter itself: incremental integration targeting Python 3.16, the build system already compiling CPython with Rust across platforms in CI, a ~60-contributor team led by core developers, and open discussion of sanitizer compatibility and acceptance criteria.
  • Three years migrating latency-sensitive services to Rust - Stephen Blum's writeup of a three-year migration of latency-sensitive services from Python, Go, JVM, and C, measured against fifteen dashboard panels that predated the migration: replacing an nginx balancer with Pingora took average balancer time from 600ms to 101ms on identical hardware and traffic, hottest-path publish latency fell from ~350µs to ~50µs, and a candid post-mortem covers a Tokio failure where unbounded task-per-request spawns grew a 100 MiB pod to 3.7 GiB until backpressure at the ingest edge fixed it.
  • gRPC Rust - Tonic officially moved into the gRPC project under the CNCF, with Google building a new production-grade grpc-rust implementation alongside it.
  • InfluxDB Rust monolith - InfluxData rewrote core account and resource management APIs from Go microservices into a single Rust monolith, using the strangler pattern for a zero-downtime migration.
  • Grab's Counter Service - Grab deliberately rewrote a Go service in idiomatic Rust rather than translating it line by line, migrating traffic incrementally.
  • rustls - Memory-safe TLS library in Rust, Prossimo-funded and available as an officially supported TLS backend in curl, giving the incumbent C TLS ecosystem a production Rust alternative.
  • Rustwright - Alpha Rust reimplementation of Playwright's browser-control engine under Playwright-shaped Python and Node APIs; reports 515 shared parity cases and 1,046 Docker-gate tests, plus local diagnostic speed and client-memory gains, while explicitly saying full behavioral parity is not yet proven.
  • Turso - Rust rewrite of SQLite evolving into a pluggable database core; its new PostgreSQL frontend compiles PostgreSQL syntax and types to Turso bytecode, targets common-application compatibility rather than 100% PostgreSQL parity, and documents simulation, oracle, fuzz, and formal-method testing.
  • WhatsApp wamedia rewrite - Meta's writeup of rewriting WhatsApp's media validation library from 160,000 lines of C++ to 90,000 lines of Rust, validated with differential fuzzing and a parallel rollout with rollback, with performance and memory improvements.
  • libsignal - Signal's Rust cryptography and protocol library, migrated from libsignal-protocol-c and shipped to billions of devices behind FFI bridges to Swift, Java, and TypeScript.
  • OpenAI Codex CLI TypeScript-to-Rust rewrite - OpenAI's announcement and tracking thread for taking the Codex CLI native: zero-dependency single-binary installs, native sandbox bindings (Seatbelt on macOS, Landlock on Linux), no garbage-collection pauses in long agent sessions, and an MCP-capable wire protocol; the TypeScript version was kept on bugfixes until the Rust build reached parity, and the repository is now almost entirely Rust.
  • Ubuntu 26.04 LTS memory-safe defaults - First Ubuntu LTS shipping Rust reimplementations as defaults: uutils coreutils (full replacement, including the last GNU holdouts cp, mv, and rm), sudo-rs as the default privilege tool, and new kernel drivers and subsystems in Rust; the coreutils cutover was gated on two commissioned Zellic audit rounds that raised 113 issues, 44 of them assigned CVEs.

Language Toolchains Rewritten in Rust

The loudest mass migration of all: other languages' compilers, package managers, linters, type checkers, and bundlers rebuilt in Rust, usually 10-100x faster than the tools they replace. AI-authored toolchain rewrites such as pacquet and tsz are listed under AI-Assisted Rewrites.

Python

  • ty - Astral's Python type checker in Rust, a fast alternative to mypy and pyright that reached beta in December 2025.
  • uv - Rust Python package and project manager designed as a fast replacement for tools such as pip, pip-tools, pipx, poetry, and virtualenv.
  • Ruff - Rust Python linter and formatter that replaces or consolidates tools such as Flake8, isort, and Black.
  • Pyrefly - Meta's Rust rewrite of its OCaml-based Pyre type checker, built on a custom incremental computation engine and validated on Instagram's codebase before its 1.0 release in 2026.
  • pixi - Prefix.dev's Rust package manager for the conda ecosystem, built on the rattler crates — a full Rust reimplementation of conda metadata, SAT solving, downloading, and installing that has since moved into the conda organization itself.
  • tar-codec - Astral's from-scratch Rust tar encoder/decoder that replaced uv's previous tar library from 0.13, roughly 2x faster and written against the parser-differential and TARmageddon (CVE-2025-62518) lessons so uv and pip see the same files.

JavaScript and TypeScript

  • Astro 7 - Astro rewrote its .astro compiler in Rust, made its Rust-powered Markdown and MDX pipeline the default, and reports 15-61% faster builds across benchmark sites.
  • Biome - Rust web toolchain for formatting, linting, and code analysis, positioned as a faster alternative to common JavaScript tooling.
  • Deno 2.0 - Rust-based JavaScript and TypeScript runtime with Node.js and npm compatibility, plus built-in formatter, linter, test runner, and task runner.
  • Lightning CSS - Rust CSS parser, transformer, bundler, and minifier used by Parcel and other tools.
  • Next.js Compiler - Rust/SWC-based compiler that replaces Babel for individual files and Terser for minification in Next.js.
  • Oxc - Rust JavaScript tooling stack covering parser, linter (oxlint), formatter, transformer, resolver, and minifier.
  • Rolldown - Rust Rollup-compatible bundler used by Vite to replace its previous esbuild/Rollup split.
  • Rspack - Rust Webpack-compatible bundler designed for progressive migration from Webpack.
  • SWC - Rust platform for JavaScript and TypeScript compilation that replaces Babel; the base layer under the Next.js Compiler and many other tools.
  • Tailwind CSS v4 - New high-performance Tailwind engine using Rust-powered pieces and Lightning CSS, with substantially faster full and incremental builds.
  • Turbopack - Vercel's Rust-based successor to Webpack, introduced through Next.js.
  • tsrs - Cloudflare, VoidZero, and Owner.com's agent-written Rust port of the TypeScript 7 compiler, incubated in Oxc: up to 8x faster type-checking than TypeScript 7.0 with about 70% less memory at equal checker workers, tracking the Go implementation as the spec, with optimizations already upstreamed into the TypeScript 7.1 beta.

Ruby

  • Porting the YJIT Ruby Compiler to Rust - Shopify ported Ruby's YJIT JIT compiler from C to Rust, shipping as the default in Ruby 3.2; the write-up covers fighting the borrow checker over cyclic compiler data structures and why Rust still won on development velocity and safety.

Cross-Ecosystem

  • mise - Polyglot tool version manager and task runner in Rust (formerly rtx), a drop-in replacement for asdf, nvm, pyenv, rbenv, and direnv, with native backends steadily replacing asdf's shell-script plugins.
  • proto - Moonrepo's Rust-based multi-language toolchain manager, using WebAssembly plugins instead of shell scripts to version Node.js, Bun, Deno, Python, and other runtimes.
  • Laravel Rust - Laravel's own beta port of the full-stack PHP framework to idiomatic Rust (Axum/Tokio, compile-time checked routes, validation, and queries), claiming near feature parity with Laravel PHP and 18x faster runs with lower CPU and memory in internal Laravel Cloud benchmarks.

Tools and Interop

Translators, migration platforms, and the FFI/interop machinery that makes incremental migration practical.

  • C2Rust - C-to-Rust translator and refactoring toolkit for migrating C code to Rust.
  • Corrode - Older C-to-Rust translator, useful historical context for deterministic translation.
  • Crustify - Repository-level generation of safe Rust bindings for C, ordered by dependencies and checked with coverage-guided equivalence and undefined-behavior tests, sanitizers, and Miri; one developer covered 41.9% of libgit2's and 42.8% of FFmpeg's public APIs.
  • ShiftCodex - AI code migration platform built around translate, test, fix, and re-run loops.
  • autocxx - Google's tool for calling C++ from Rust with a safe, generated binding layer, designed for incrementally introducing Rust into large C++ codebases such as Chromium.
  • crubit - Google's bidirectional C++ and Rust interoperability tooling.
  • cxx - Safe interop between Rust and C++ with a shared bridge definition and static analysis of the boundary.
  • bindgen - Generates Rust FFI bindings from C and C++ headers, the first tool most migrations touch.
  • uniffi - Mozilla's toolkit for generating foreign-language bindings from Rust, used to ship Rust cores behind Kotlin, Swift, and Python APIs.
  • corrosion - CMake integration for Cargo, for adding Rust targets to existing C and C++ builds.
  • Rust/C++ Interop Initiative - Rust Foundation initiative mapping and closing Rust/C++ interoperability gaps, the practical prerequisite for incremental C++ to Rust migration in large codebases.
  • CO3: Toward the Optimal FFI - Design exploration of a bidirectional Rust/C FFI model: pure-Rust declarations for imports and exports of functions, statics, methods, and opaque types, with ownership transfer across the boundary and static monomorphization or runtime tag dispatch where C has no generics.
  • neon - Safe Rust to Node.js bindings, the standard way to put a Rust core behind Electron desktop apps.
  • wasm-bindgen - Rust to WebAssembly bindings, used to ship shared Rust cores into web apps and browser extensions such as Proton Pass.

Research

Academic work on C-to-Rust translation, from LLM-assisted pipelines to program-analysis-guided migration.

  • C2RustXW - C-to-Rust translation that combines program analysis, LLM translation, dependency-aware ordering, and execution-based validation.
  • EvoC2Rust - Skeleton-guided framework for project-level C-to-Rust translation.
  • Rustine - Repository-level C-to-Rust translation system targeting compilable, idiomatic, safer Rust with test-verified functional equivalence.
  • &inator - Correct and precise C-to-Rust interface translation.
  • SafeTrans - LLM-assisted C-to-Rust transpilation with iterative repair.
  • Automatically Translating C to Rust (CACM, November 2026 cover story) - KAIST survey of the refinement-pass approach to C2Rust output: static analyses that replace scalar pointers, locks, tagged unions, and output parameters with safe idiomatic Rust, the remaining unsafe-feature checklist, and a measured look at LLM split-translate-check-fix workflows.
  • SACTOR - LLM-driven multi-step C-to-Rust translation using static analysis.
  • RustMap - Project-scale C-to-Rust migration using program analysis, LLMs, dependency guidance, and test feedback.
  • Re-Testing LLM-Based C-to-Rust Translations Against Their Original C - Independent November 2026 evaluation of 34 translators, re-testing all 11 with runnable source and output: 160 defects, including 93 errors on ordinary inputs, while project-supplied checks accepted 86 defective translations.
  • LLM4C2Rust - Retrieval-augmented C/C++ to Rust transpilation framework focused on memory safety.
  • Scylla - Formalized translation of an applicative subset of C to safe Rust, targeting memory safety by construction rather than after-the-fact cleanup.
  • CNnotator - LLM-guided synthesis of CN memory-safety annotations for C code, cutting the manual annotation effort needed to verify legacy C during migration.
  • MISRust - Mapping of MISRA-C++ safety-critical coding guidelines to Rust, supporting qualification arguments for Rust in safety-critical migrations.

Guides, Articles, and Talks

Practical write-ups on how teams actually run these migrations.

Choosing Crates

A migration is not finished when the code compiles — the next question is which crates to build on. These are curated, opinionated answers from people who have spent serious time in the ecosystem.

  • blessed.rs - Community-curated guide to the crates most often reached for per task, organized by domain; the standard answer to "which crate should I use".
  • stdx - Kerkour's extended-standard-library project: a curated, supply-chain-conscious set of crates designed to work from 2 KiB embedded targets up to large servers.
  • Lessons learned building stdx - The design rationale behind stdx: why an extended standard library, heap-allocation discipline, and runtime-agnostic APIs.
  • Rust Cookbook - Practical recipes for common tasks using the best crate for each job, from the Rust Nursery.

Adjacent Lists

Footnotes

This list is intentionally narrow. It is not a general Rust list, a general AI coding list, or a list of greenfield Rust projects. Scale and ambition matter: entries should replace a meaningful surface of an established system or demonstrate unusual migration scope. Small wrappers, plugins, and accelerators are out of scope even when they are useful and well built.

Good entries should show at least one serious validation signal: test results, compatibility target, benchmark data, migration log, source and target code links, or discussion of unsafe code and semantic gaps.

Contributions are welcome. See CONTRIBUTING.md. To steer the list's direction, join the standing direction discussion; to propose content without opening a PR, use the suggest-an-entry thread.

This list started as an expansion of malisper's Awesome AI Rust Rewrites (CC0), which is linked in Adjacent Lists above.

Jelajahi proyek terkait

Memuat…