Rust, C++, or Carbon?

Sep 21, 2022

In 2022, there are still many memory access bugs in C++ that are difficult to spot and elude even the closest reviews. Issues that can't be solved without breaking backward compatibility for users. Decades of technical debt.

C++ will continue to endure for decades, but greenfield projects that fit the requirements should consider an alternative.

What's the best alternative for performance-critical software? A few options: Zig, Rust, Carbon, or C++.

A strong but probably correct statement from Mark Russinovich, the CTO of Azure and the author of many deep debugging and technical dev utilities. It's not just Microsoft invested in Rust, but companies like Cloudflare. For example, Cloudflare is replacing Nginx with its HTTP proxy ("Pingora") written in Rust.

We chose Rust as the language of the project because it can do what C can do in a memory safe way without compromising performance.

Rust has even been merged into the Linux Kernel as the second official language.

Google is taking a different approach. An alternative probably needs enough interoperability with C++ code and C without inheriting the pitfalls of those languages. Carbon is their answer to that. Google has shown enough use cases to internally dog food languages into adoption (e.g., Go). Using Carbon internally (and externally for something like Chromium) might be enough to justify the investment.

Carbon will also come with a built-in package manager (similar to what I talked about in a first-class language package manager).

Subscribe for daily posts on startups & engineering.