Is Rust Replacing C++ for New Low-Latency Projects?
The Question
I’ve been watching the low-latency systems space for years. When I started, C++ was the only game in town for high-frequency trading, game engines, and real-time systems. But lately, I keep seeing job postings and GitHub projects that say “Rust preferred” or “Rust for new services.”
This got me wondering: Is Rust actually replacing C++ for new low-latency projects? Or is this just hype from the Rust community?
What I Found
I dug into Reddit discussions and found a thread with 62 upvotes asking exactly this question. The answers surprised me. They weren’t the typical “Rust is better” fanboy responses. Instead, they painted a nuanced picture of what’s actually happening in the industry.
The top comment (102 points) cut straight to the point:
“Rust is growing though, especially for new projects, since it gives better memory safety.”
Another engineer working in the field (1 point) added:
“New low latency services are in rust now. Although a new DB was written from scratch last year in C++.”
This pattern repeated throughout the discussion. Rust is winning new projects, but C++ isn’t dying. It’s more complicated than that.
The Shift Toward Rust for New Projects
Why are companies choosing Rust for new low-latency work? I think it comes down to one thing that matters more than any benchmark: memory safety without garbage collection.
Memory Safety: The Killer Feature
Let me show you what I mean. Here’s a classic C++ bug that causes undefined behavior:
#include <iostream>#include <vector>
int main() { std::vector<int> data = {1, 2, 3, 4, 5};
// Get a pointer to the first element int* ptr = &data[0];
// Push more elements - this may reallocate the vector data.push_back(6); data.push_back(7); data.push_back(8); data.push_back(9); data.push_back(10);
// ptr now points to freed memory! // This is undefined behavior - could crash, could corrupt data std::cout << *ptr << std::endl; // DANGER: use-after-free
return 0;}This code compiles. It might even run fine in testing. But in production, under load, it can cause crashes, data corruption, or security vulnerabilities. I’ve seen teams spend weeks debugging similar issues.
Now look at the Rust equivalent:
fn main() { let mut data = vec![1, 2, 3, 4, 5];
// Try to get a reference and then modify the vector let ptr = &data[0]; // Immutable borrow
data.push(6); // ERROR: cannot borrow `data` as mutable // because it is also borrowed as immutable
println!("{}", ptr);}Rust’s borrow checker catches this at compile time. The code won’t even compile. I don’t have to worry about this class of bugs in production.
Zero-Cost Abstractions
People sometimes think Rust’s safety comes with a performance penalty. I thought the same thing at first. But Rust’s abstractions compile down to the same machine code as hand-written C++.
// This iterator chain looks "high-level"let sum: i32 = (1..=100) .filter(|x| x % 2 == 0) .map(|x| x * 2) .sum();
// But it compiles to the same tight loop as this C++:// int sum = 0;// for (int i = 2; i <= 100; i += 2) {// sum += i * 2;// }For low-latency systems, this matters. I get memory safety without sacrificing the performance characteristics that make C++ the default choice.
Where C++ Still Dominates
The Reddit thread made it clear: C++ isn’t going anywhere. One comment stood out:
“Very little work nowadays is truly greenfield.”
This is the key insight. Most engineering work happens inside existing ecosystems.
Existing Codebases
I’ve seen trading firms with millions of lines of C++. They’re not rewriting that in Rust. The risk and cost would be enormous. Instead, they:
- Keep the C++ core running
- Write new microservices in Rust where it makes sense
- Build Rust components that interoperate with C++ via FFI
As one commenter noted (6 points):
“Rust seems to be getting adopted for new components”
This is the reality I see: Rust for new services, C++ for existing systems.
Team Expertise
A database team with 20 years of C++ experience isn’t going to switch to Rust overnight. That expertise is valuable. As the thread mentioned, “a new DB was written from scratch last year in C++” - even in 2025, teams choose C++ when their expertise lies there.
I think this is often overlooked. Language choice isn’t just about technical merits. It’s about:
- Who’s available to hire
- How fast you can onboard new engineers
- Whether your existing team can review and maintain the code
The Greenfield Reality
Here’s what I’ve observed in practice. When teams start something genuinely new - a fresh microservice, a new tool, a clean-slate prototype - Rust is often the default choice now.
But “new project” is rarer than you might think. Most “new” projects have constraints:
- Must integrate with existing C++ libraries
- Team only knows C++
- Timeline requires using known tools
- Existing infrastructure expects C++ binaries
For truly greenfield work without these constraints, Rust wins more often than not.
Skills Transferability
One thing the Reddit thread emphasized (3 points):
“However if you learn rust well, lots and lots of the concepts translate to cpp in varying forms.”
I found this to be true. Learning Rust taught me:
- Ownership semantics that apply to modern C++ (unique_ptr, move semantics)
- Why C++ added borrow checking concepts in C++26
- How to think about lifetime annotations
- Better patterns for resource management
The skills flow both ways. My C++ experience helped me understand what Rust was doing under the hood. Rust made me a better C++ programmer by forcing me to think explicitly about ownership.
Decision Framework for New Projects
When I’m choosing between Rust and C++ for a new project, I use this framework:
Choose Rust When:
- Starting truly new - No legacy integration requirements
- Memory safety is critical - Network services, parsers, anything processing untrusted input
- Team is open to learning - Rust has a learning curve but pays off
- Long-term maintenance matters - Rust’s strictness prevents bugs that cost time later
- Concurrency is required - Rust’s ownership model makes concurrent code safer
Choose C++ When:
- Integrating with existing C++ code - FFI adds complexity
- Team has deep C++ expertise - Don’t underestimate the value of experience
- Library ecosystem matters - Some domains have better C++ libraries
- Specific compiler/toolchain requirements - Some embedded targets only have C++ toolchains
- Hiring locally - In some markets, C++ developers are easier to find
A Practical Example
I recently worked on a decision for a new market data processing service. Here’s how the analysis went:
Service Requirements:- Parse binary market data feeds- Sub-millisecond latency budget- Must integrate with existing trading system- Team of 4 engineers with mixed C++/Rust experienceFor this case, we chose Rust because:
- Parsing untrusted binary data - memory safety matters
- New service, not modifying existing code
- Team wanted to build Rust skills
- Latency requirements were achievable in Rust (benched both)
The Rust code looks like this:
#[repr(C, packed)]struct MarketDataHeader { msg_type: u8, sequence: u32, timestamp: u64,}
fn parse_message(data: &[u8]) -> Result<MarketDataHeader, ParseError> { if data.len() < std::mem::size_of::<MarketDataHeader>() { return Err(ParseError::TooShort); }
// Safe because we checked the length let header: MarketDataHeader = unsafe { std::ptr::read_unaligned(data.as_ptr() as *const _) };
Ok(header)}The explicit error handling and memory layout control give me confidence this code won’t have the buffer overflows I’ve debugged in C++ parsers.
Summary
Yes, Rust is replacing C++ for new low-latency projects. But the full picture is more nuanced:
- Rust wins new greenfield work when teams have the flexibility to choose
- C++ stays dominant in existing systems and teams with deep C++ expertise
- The trend is real - new low-latency services are increasingly written in Rust
- Skills transfer - learning Rust makes you a better C++ developer too
The industry isn’t rewriting everything in Rust. It’s writing new things in Rust while maintaining C++ systems. If you’re starting something new, Rust should be your default consideration. But don’t underestimate the value of team expertise and existing ecosystem integration.
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