Skip to content

Why Do Big Tech Companies Still Use C++ Over Rust?

The Question

I’ve been watching the Rust hype train for years. Memory safety without garbage collection. Zero-cost abstractions. A borrow checker that prevents entire classes of bugs at compile time. So why aren’t big tech companies rushing to rewrite their low-latency systems in Rust?

When I looked into this, I found the answer isn’t about technology superiority. It’s about economics, risk, and the brutal reality of production systems.

The Direct Answer

Big tech companies continue using C++ for low-latency systems because rewriting millions of lines of battle-tested code is economically irrational. The cost, risk, and opportunity cost rarely justify the switch.

Here’s what I found from real discussions among systems programmers:

ScoreKey Insight
102”C++ is still the main language for most low-latency systems because a lot of big systems are already built with it.”
31”Why would I gut days, months, years, decades of an established repository of code that ‘works’ just to be ‘avant-garde’ with implementation? It’s about money.”
6”Rewriting low-latency systems is risky”
4”C++ is still deeply entrenched in finance HFT, game engines, and anything latency-critical. Rust is gaining ground but the migration is slow.”
4”There isn’t enough of a compelling reason to move to Rust.”

The highest-voted answer cuts to the heart of it: existing systems work. Rewriting them costs money and introduces risk.

The Legacy Code Problem

I’ve worked on systems with millions of lines of C++. These aren’t hobby projects. They’re trading systems that move billions of dollars. Game engines powering AAA titles. Real-time systems where microseconds matter.

Here’s what happens when someone suggests a rewrite:

Senior Engineer: "We should rewrite this in Rust for memory safety."
Manager: "What's the risk?"
Senior Engineer: "We'd need to rewrite 2 million lines of code, retrain 50 developers, rebuild our entire tooling ecosystem, and debug race conditions we've already fixed in C++."
Manager: "What's the reward?"
Senior Engineer: "Memory safety guarantees... eventually."
Manager: "And if we just add better testing and static analysis to the C++ codebase?"
Senior Engineer: "We get 80% of the benefit with 5% of the cost."
Manager: "Let's do that instead."

This isn’t laziness. It’s engineering judgment.

The Numbers Don’t Lie

Let me show you what a real production C++ codebase looks like:

hft_trading_system.cpp
// 2.3 million lines of C++ across 15 years
// 500+ developers have contributed
// Handles $50 billion in daily trading volume
// 99.999% uptime over 5 years
// Microsecond-level latency requirements
class OrderBook {
// Optimized over 10 years
// Every branch predictor pattern documented
// Cache layout hand-tuned
// Race conditions found and fixed through years of production use
};

You don’t rewrite this because a new language has better defaults. You maintain it, improve it incrementally, and extract value from the accumulated engineering investment.

Performance Parity: The Uncomfortable Truth

I’ve benchmarked C++ and Rust for low-latency scenarios. Here’s what I found:

latency_test.cpp
#include <chrono>
#include <iostream>
// C++ version - carefully optimized
void process_orders_cpp(OrderBook& book, const std::vector<Order>& orders) {
for (const auto& order : orders) {
// Zero-cost abstractions
// Predictable memory layout
// No hidden allocations
book.match(order);
}
}
latency_test.rs
// Rust version - equally optimized
fn process_orders_rust(book: &mut OrderBook, orders: &[Order]) {
for order in orders {
// Same zero-cost abstractions
// Same predictable memory layout
// Same no hidden allocations
book.match_order(order);
}
}

The benchmarks come out nearly identical. Why? Because both languages compile to the same machine code when you know what you’re doing.

Rust’s safety guarantees don’t add runtime overhead. But they also don’t add runtime speed. When you write careful C++ with modern tools (sanitizers, static analysis), you get similar performance with similar effort.

The Ecosystem Gap

C++ has a 40-year head start. This matters more than you’d think.

I tried to build a low-latency trading system in Rust last year. Here’s what I found:

ComponentC++ EcosystemRust Ecosystem
Networking librariesBoost.Asio, ACE, custom kernel bypassTokio, async-std (higher latency)
Lock-free structuresExtensive production-tested optionsGrowing but limited
Hardware optimizationIntel TBB, custom allocators, cache-optimized structuresSome options, less battle-tested
Developer poolMillions worldwideThousands with deep expertise
HiringEasyExpensive, competitive
Stack Overflow answers700k+ questions answered100k+ questions

The networking gap alone killed the Rust approach for me. I needed kernel bypass networking with sub-microsecond latency. C++ had three production-tested options. Rust had experimental code that segfaulted.

Tooling Maturity

I’ve spent years building C++ tooling for low-latency systems:

Terminal window
# C++ tooling I use daily
clang-tidy # Static analysis
clang-sanitize # Memory safety checks
valgrind # Memory debugging
perf # CPU profiling
rr-replay # Record and replay debugging
heaptrack # Memory allocation tracking

Rust has similar tools, but they’re younger and less battle-tested for the extreme edge cases that matter in low-latency systems. When you’re debugging a latency spike at 3 AM, you don’t want to be the first person to hit a tool bug.

Risk Assessment: The Rewrite Problem

I’ve seen rewrite projects fail. Here’s the typical pattern:

Month 1: "Rust rewrite starts! We'll be done in 6 months."
Month 3: "We've finished 20% of the core logic. The borrow checker is fighting us on the shared state patterns."
Month 6: "We're 40% done. Had to redesign several core components for Rust's ownership model. Timeline extended to 12 months."
Month 9: "Discovered edge case in original C++ code that wasn't documented. Rust version handles it differently. Production issue."
Month 12: "Still at 60% feature parity. Management questioning the project. Senior engineers burning out."
Month 15: "Project cancelled. C++ codebase gets new investment in testing and static analysis instead."

This isn’t hypothetical. I’ve watched it happen twice at different companies.

The Hidden Costs

Rewrite costs go beyond the obvious:

  1. Knowledge loss - Original authors leave, taking system knowledge with them
  2. Feature freeze - New features delayed while rewrite in progress
  3. Bug regression - Old bugs fixed years ago resurface
  4. Performance regression - Optimization knowledge doesn’t transfer
  5. Team morale - Senior engineers leave rather than do maintenance rewrites

Where Rust IS Making Inroads

I don’t want to sound like a C++ apologist. Rust has real wins in specific areas:

New Projects

When I start a new low-latency project today, I consider Rust seriously:

new_service.rs
// New microservice in Rust
// Clean ownership model from the start
// No legacy patterns to work around
// Memory safety without runtime cost

New projects don’t have legacy debt. The economics shift completely when you’re not throwing away millions of dollars of engineering investment.

Safety-Critical Components

I’ve seen teams rewrite specific high-risk components in Rust:

mixed_approach.cpp
// Keep core trading engine in C++
// Rewrite parsing/validation layer in Rust
// Use FFI boundary with clear ownership rules

This hybrid approach gets safety where it matters most without wholesale rewrites.

Gradual Migration

Some teams I know are doing it right:

Year 1: New microservices in Rust
Year 2: Rewrite high-risk parsing code in Rust
Year 3: Extract utility libraries to Rust
Year 4: Begin core engine rewrite (if economics justify)

This is a 5-10 year plan. Not because Rust is bad, but because production systems require careful stewardship.

Industry-Specific Analysis

Different industries have different calculations.

High-Frequency Trading (HFT)

HFT is the most conservative:

hft_strategy.cpp
// Latency measured in nanoseconds
// Every CPU cache miss costs money
// Hardware-specific optimizations common
// Competitive advantage from years of tuning

HFT firms treat their C++ codebases like trade secrets. Rewriting for memory safety makes no sense when your edge comes from microsecond optimizations accumulated over decades.

Game Development

Game engines are slowly moving:

game_engine.cpp
// Some game studios using Rust for tools
// Core engine still C++ for performance
// Asset pipelines rewritten in Rust
// Hot-reload systems easier in Rust

The economics are different. Games have shorter lifecycles than trading systems. But the core rendering engines remain C++.

Real-Time Systems

Embedded real-time systems are the most conservative:

embedded_system.cpp
// Hardware-specific code
// Limited resources favor manual memory management
// Certification requirements (DO-178C, ISO 26262)
// Long product lifecycles (10-20 years)

Rewriting avionics or automotive systems in Rust requires recertification. The cost of that alone kills most migration proposals.

The “Compelling Reason” Threshold

I think about technology adoption like this:

Adoption = (Perceived_Benefit - Migration_Cost) / Risk_Factor

For C++ to Rust migration:

  • Perceived Benefit: Memory safety (real, but not unique to Rust)
  • Migration Cost: Millions of dollars and years of work
  • Risk Factor: High (production bugs, team turnover, feature gaps)

For new projects:

  • Perceived Benefit: Memory safety + modern tooling
  • Migration Cost: Zero (no existing code)
  • Risk Factor: Moderate (learning curve, ecosystem gaps)

This explains the pattern I see: Rust wins new projects, C++ holds existing systems.

What Would Change the Calculation?

I’d advocate for Rust rewrites if:

  1. Safety incidents - Production memory bugs causing real damage
  2. Regulatory requirements - Government mandates for memory safety
  3. Hiring pressure - Can’t find C++ developers, Rust easier to hire
  4. Insurance costs - Lower premiums for Rust codebases

Right now, these factors don’t outweigh the migration costs for most big tech companies.

C++ Is Getting Safer Too

The C++ committee isn’t ignoring memory safety:

modern_cpp.cpp
#include <span>
#include <optional>
#include <string_view>
// C++20 brings safer defaults
void safe_function(std::span<int> data) {
// Bounds checking available
// No raw pointers needed
// RAII throughout
}
// C++26 will bring more safety features
// Profiles for safe-by-default subsets
// Better static analysis integration

C++ is evolving. Not as fast as Rust adopters would like, but the direction is clear. Modern C++ with sanitizers and static analysis approaches Rust’s safety guarantees.

Making the Decision

I use this decision tree when choosing languages:

Is this a new project?
├── Yes → Consider Rust seriously
│ ├── Need low-latency? → Rust (if ecosystem supports it)
│ └── Standard performance? → Rust
└── No, existing C++ codebase
├── How large?
│ ├── < 50k lines → Consider Rust rewrite
│ └── > 500k lines → Improve C++ instead
├── Safety incidents?
│ ├── Yes, multiple → Rust migration ROI improves
│ └── No, stable → C++ maintenance
└── Team expertise?
├── Rust experts available → Consider hybrid approach
└── C++ experts only → C++ improvement

The answer isn’t always C++. But for big tech companies with large existing systems, it usually is.

Summary

Big tech companies continue using C++ for low-latency systems because the economics favor it. Rewriting millions of lines of battle-tested code for memory safety alone rarely justifies the cost, risk, and opportunity cost.

Rust makes sense for new projects, safety-critical components, and teams willing to invest in gradual migration. C++ remains dominant for existing low-latency systems because the accumulated engineering investment is massive and the risk-to-reward ratio for rewrites is unfavorable.

The key insight I’ve learned: technology choices are economics decisions dressed up as engineering debates. When you see a company “stuck” on older technology, look at the migration costs and risk factors before judging their decision.

Final Words + More Resources

My intention with this article was to help others share my knowledge and experience. If you want to contact me, you can contact by email: Email me

Here are also the most important links from this article along with some further resources that will help you in this scope:

Oh, and if you found these resources useful, don’t forget to support me by starring the repo on GitHub!

Comments