proomt

Search

Search posts, papers, and topics

All posts

GitHub OldStephen Toub65 min readadvanced

Migrating the GitHub Copilot runtime to Rust, using Copilot

Summary

The Copilot agent runtime was rewritten from a 130‑k‑line TypeScript/Node.js codebase into a native Rust library (~830 k lines of Rust) to reduce startup latency, memory use, and improve reliability. The migration was done incrementally (in‑place) across 128 PRs, with AI‑generated code handling most of the work. The new runtime exposes a C ABI for in‑process embedding by all six Copilot SDK langu…

  • Porting a large, actively‑developed runtime in‑place (component‑by‑component) avoids a costly big‑bang cutover and lets you keep up with upstream changes.
  • Rust provides low‑overhead, predictable memory and startup characteristics, making it suitable for a shared agent runtime that must be embedded in many host languages.
  • Exposing a thin C ABI enables clean in‑process embedding across C‑FFI‑compatible languages (C#, TypeScript, Python, Rust, Go, Java) without pulling in a full Node/V8 runtime.
  • Separating the TUI from the core runtime clarifies layering, allowing the UI to sit on top of a stable SDK surface instead of being intertwined with core logic.

Embedding a heavyweight Node/V8 runtime in every SDK client inflated memory (≈100 MiB per process), slowed startup, and added a failure surface. By moving to a native Rust library, GitHub can ship a lightweight, high‑performance agent that scales better in server‑side and desktop environments, redu…

7/10

Related reading

  1. Nvidia announces native GPU programming in Rust

    NVIDIA released CUDA‑Rust, letting you write GPU kernels directly in Rust and compile to PTX. Two programming models are supported: the traditional SIMT model via the `cuda-oxide` backend (nightly Rust, custom codegen) and the newer Tile model via `cutile‑rs` (stable Rust, JIT‑compiled Tile IR). Both provide Rust‑typed safety guarantees (e.g., `DisjointSlice`, tensor partitioning) and simple Carg…

    Hacker News front pagenvidia.com11 minHN961402