YouTube Summaries

← All summaries

Where C++ still beats Rust: HFT, CUDA, and game engines

2026-09-02 Wed ⏱ 16 min fknight

A counterweight to Knight's own "everything is being rewritten in Rust" videos. Rust is winning ground in the places C++ was never actually best at; in high-frequency trading, GPU/CUDA tooling, and game engines, C++ remains the pragmatic choice. Meanwhile C++'s own memory-safety answer slipped from C++26 to C++29, which is bad timing given how cheap cross-language rewrites have become.

High-frequency trading: the hot path cannot stop

Built on a talk by Juan Alday (Citadel Securities, C++ standards committee member). Illustrative latency budget for a trade: 30 microseconds total — 2 to decide, 5 for risk checks, 3 to fire the order, 20 for the network round trip, which at fiber speed means you must sit within ~2.5 miles of the exchange. Hence the hundreds of millions spent on colocation and custom low-latency networks. Miss by 10 microseconds and someone else takes the fill.

Requirement one — never pause — eliminates every GC language outright: a 5 ms collection is 5000 microseconds against a 30 microsecond budget. That drops Java, C#, Go, Python. Zig is excluded on maturity grounds rather than quality: pre-1.0, IO overhauled twice recently with breaking changes, and a tiny hiring pool.

Requirement two is the design space, not raw codegen. Rust, C, and clang all go through LLVM, so an expert-written algorithm compiles to essentially the same instructions — there is no inherent binary-speed argument. The difference is what designs the language lets you express comfortably: lock-free ring buffers between the network thread and the trading logic, intrusive data structures where one object lives in several lists at once, pointers into everything. Rust's atomics are safe Rust and a plain lock-free ring buffer is fine, but as the designs get gnarlier — intrusive structures, manual memory reclamation, pointer relationships the compiler cannot prove — you end up in raw pointers and audited unsafe cores, which is exactly what Rust's lock-free libraries do internally. That is a legitimate Rust pattern, but it means the money-making code is C++-style code written in a language that fights you on it. C++ also gives placement new for arena allocators and cache-line-aligned pools ("you own the data path"); Rust's per-container custom allocator API has been unstable for over a decade. C++26 additionally standardizes hazard pointers and RCU — the lock-free toolkit these firms hand-rolled — and since those firms staff the committee, they steer the language toward their own use case.

GPUs and AI: it is the toolchain, not the speed

LLMs run on NVIDIA GPUs programmed via CUDA, a set of C++ extensions. cuBLAS, cuDNN, TensorRT, PyTorch's core — all C++ and CUDA. Rust GPU work exists and is promising: NVIDIA research published a Rust matrix-multiplication implementation hitting 96% of cuBLAS on a B200. But that is a paper, whereas the C++ production stack — compiler, profiler, debugger, decades of tuned kernels — is what ships. Knight's punchline: every time an AI model ports a C++ codebase to Rust, C++ did the math.

Game development: ecosystems have thousands of owners

A codebase has one owner who can decide to port it; an ecosystem has engine makers, middleware vendors, plugin authors, and a hiring pool. Unity is a C++ engine with a C# scripting layer; Unreal is C++ to the core. Embark Studios declared Rust their primary language, yet shipped Arc Raiders on Unreal Engine 5 with C++ in the core stack — the SDK, middleware, plugins, and their own experience all pointed there. Gameplay code is also largely throwaway: testing a mechanic that turns out to suck is cheaper in C++ than fighting the borrow checker to find that out. Bevy may build its own ecosystem over 5–10 years. Notably Embark does use Rust for tooling, and started Rust GPU — the recurring pattern where Rust takes the parsers, services, and everyday systems code around the C++ core.

The safety fight C++ had with itself

Memory safety is the main reason Rust gains ground, and C++ knows it. After governments urged memory-safety roadmaps by January 2026, the committee weighed two approaches: Sean Baxter's Safe C++, borrow checking inside C++ with a working compiler prototype, versus profiles (Stroustrup, Sutter) — modes you switch on without rewriting existing code. In September 2025 the committee prioritized profiles, on the argument that Safe C++ cannot protect billions of existing lines without migrating them — and if you are migrating anyway, you start shopping for other languages. The problem is there is still no shipping solution: profiles missed C++26 and are now targeted at C++29, i.e. 2029, precisely when rewrites are cheapest they have ever been. Counterpoint from Herb Sutter: C++ added roughly as many new developers in one year as Rust has in total. C++ is not dying. If the C++29 safety work lands, some of the ground Rust took may come back.