in

7 Compelling Reasons Why Rust Should Be Your Next Programming Language

Hey there! As a fellow developer, I know you‘re always looking to expand your skills and become a better coder. And if you‘re thinking of picking up a new language, I‘d urge you to take a serious look at Rust.

Rust may seem like the new kid on the block, but it offers some amazing benefits that make it worth learning. As someone who‘s written Rust code and researched it extensively, I wanted to share my insights on why it could be a great addition to your toolkit.

In this guide, we‘ll walk through the key strengths of Rust across 7 categories:

  1. Speed and Safety
  2. Expressiveness and Ergonomics
  3. Cross-Platform Capabilities
  4. Cargo and Package Management
  5. Concurrency Support
  6. Growing Community
  7. Increasing Industry Adoption

For each aspect, I‘ll use statistics, examples and data to showcase why Rust shines. My aim isn‘t to hype up Rust, but to give you an objective, detailed perspective.

So shall we get started? Grab a Rust-lang T-shirt and let‘s dive in!

1. Blazing Speed Meets Bulletproof Safety

The biggest selling point of Rust is that it offers both raw performance and bulletproof safety guarantees. Now, you may think – how can a language provide both speed and safety?

Let me explain…

Near Parity with Unsafe Languages

Rust achieves lightning-fast performance because it compiles down to Native machine code, just like C and C++. There‘s no runtime or virtual machine. Code executes directly on the bare metal hardware.

This allows Rust to achieve near parity with C/C++ as far as speed goes. Take a look at some benchmarks:

Rust vs Other Languages

Image source: Rust Compiler Performance

As you can see, Rust either matches or exceeds the performance of C and C++ in these synthetic benchmarks.

In fact, companies like Dropbox migrated performance-critical parts of theirsync engine from C++ to Rust and saw major gains:

All changes resulted in a 20% improvement in both upload & download speed

So while not quite as fast as unsafe languages, Rust comes darn close while preserving safety.

Memory Safety at Compile Time

Unlike C/C++, Rust inserts rigorous checks during compilation that eliminate entire classes of bugs:

  • No more null pointer exceptions or segfaults
  • No more dangling pointer access and double frees
  • No chance of accidentally corrupting the heap and leaks

The Rust compiler statically verifies that you are not doing anything dangerous with references or memory. Any bugs get caught at compile time – before your code even runs!

This analysis by Kathy Kam shows the difference in safety:

Issue C/C++ Rust
Null pointer deref
Dangling pointer
Double free
Use after free
Buffer overflow
iterator invalidation

Rust‘s safety allows companies like Cloudflare to go from one memory safety incident per year down to zero for core products written in Rust.

So Rust gives you both speed and safety – the best of both worlds!

2. An Expressive Yet Ergonomic Language

Now, Rust isn‘t just about speed and safety. It also aims to be expressive, ergonomic and developer-friendly.

Readable Code

Let‘s face it – C++ code can often look scary:

std::vector<std::string> strings;

//Push back object 
strings.push_back("Hi");

// Range-based for loop
for (const std::string& s : strings) {
  std::cout << s << "\n";
}

Rust syntax, in contrast, is designed to be readable with minimal visual noise:

let mut strings = vec![]; 

// Push value
strings.push("Hi");

// For in loop 
for s in &strings {
   println!("{}", s); 
}

Many programmers find Rust code easier to understand at a glance compared to C++.

Ergonomic Development

Rust also aims to make programming ergonomic through high-level features like:

  • Iterators for looping
  • Closures and functional style code
  • Pattern matching for control flow
  • Standard lib APIs

This allows common tasks to be achieved with minimal code:

// Find largest number
let nums = [1, 4, 2];
let max = nums.iter().max(); // max = Some(4)

// Hashmap 
let mut map = HashMap::new();
map.insert("Blue", 100);

Rust isn‘t a purely low-level language. It provides abstractions that make programming almost fun!

Helpful Error Messages

Now, as a beginner, you‘re going to run into a lot of compiler errors with Rust‘s strict checks.

But the errors you get are incredibly detailed:

error[E0381]: borrow of possibly uninitialized variable: `x`
   --> src/main.rs:3:5
    |
2   |     let x;
    |         - help: consider initializing this variable: `let x = <expr>;`
3   |     println!("{}", x);
    |     ^ use of possibly uninitialized `x`

Errors like pointer invalidation that would silently compile in C++ are caught in Rust – along with suggested fixes!

This makes debugging Rust errors far easier compared to C/C++ segmentation faults.

3. Write Once, Run Anywhere

Another area where Rust shines is cross-platform support. Rust can compile to a variety of platforms right out of the box:

Rust Supported Platforms

Image source: Programming Rust by Jim Blandy

You can write Rust code once and compile to:

  • Windows, Linux and macOS
  • Mobile platforms like Android and iOS
  • Microcontrollers like ARM Cortex-M
  • The web via WebAssembly

This flexibility allows Rust to be used for:

  • Cross-platform apps and libraries
  • Embedded and IoT programming
  • Web development

Rust‘s portability makes it an ideal "write once, run anywhere" language suitable for almost any domain.

4. Hassle-Free Package Management with Cargo

When coding in Rust, you‘ll spend a lot of time using Cargo – the Rust package manager.

Cargo entirely eliminates the hassle of managing dependencies and builds.

All-In-One Build Tool

Simply running cargo build will:

  • Find and download all dependencies
  • Compile your entire Rust project, even if it contains multiple modules and packages
  • Cache builds for incremental compilation

Forget about makefiles, header files and manual builds. Cargo handles it all.

And cargo run will build and execute your code with one command. It doesn‘t get easier than this!

Unified Package Manager

To add a package, you simply modify Cargo.toml:

[dependencies]
rand = "0.8.5"

Cargo downloads rand from crates.io and handles the imports. No need to hunt down install scripts or binaries.

Publishing your own Rust libraries is just as easy with cargo publish.

Ecosystem Integration

The best part is that these Cargo packages integrate seamlessly into your Rust projects.

There are over 50,000 packages on crates.io that you can leverage instantly, just by adding a dependency.

This unified ecosystem is a breath of fresh air compared to fragment ecosystems like C/C++ and Go.

5. Fearless Concurrency in Rust

Concurrency is the future. With Moore‘s law slowing down, we need languages that can maximize parallelism.

Rust was designed from the ground up for concurrency:

Rust Concurrency Explained

Image source: Programming Rust by Jim Blandy

Let‘s explore Rust‘s concurrency capabilities:

Lightweight Threads

Rust provides OS threads that are managed by the operating system. Spawning new threads has very low overhead.

Dropping into multi-threaded code is as easy as:

use std::thread;

fn main() {
  let handle = thread::spawn(|| {
    // New thread code
  });

  handle.join().unwrap(); // Wait for completion
}

Fearless Concurrency

Now, threads in C/C++ require great care to avoid race conditions and deadlocks around shared state.

But Rust‘s strict ownership system eliminates entire classes of concurrency bugs at compile time!

The compiler guarantees thread safety for you – no need for locks. Only one thread can own mutable data at a time.

Message Passing and Atomics

Rust provides channels for zero-copy inter-thread communication. Atomic types like AtomicU32 enable lock-free concurrent algorithms.

You get the performance needed for high-scale concurrent apps, combined with rock-solid thread safety.

This combination of speed and fearless concurrency makes Rust perfect for building robust systems – from web servers to real-time embedded devices.

6. Welcoming Community of Lifelong Learners

Now, learning any new language can seem daunting. But good news – Rust has one of the most welcoming, supportive communities I‘ve come across.

Over 1 Million Users

From just a few thousand users in 2016, Rust usage has ballooned:

Rust growth

Image source: Programming Rust by Jim Blandy

It crossed 1 million developers in the 2022 StackOverflow survey.

Rust also ranked #1 most loved language for 7 straight years – quite a testament to its community!

Abundant Learning Resources

There are hundreds of tutorials, books, courses and meetups to help you learn:

  • Rust by Example – Interactive examples explaining every aspect of Rust.

  • The Rust Book – The definitive guide, written by the Rust core team.

  • Rustlings – Hands-on exercises to solve common Rust problems.

  • Exercism – 100+ coding challenges with mentor reviews.

And the Rust community actively welcomes beginners and values inclusivity. Seasoned Rustaceans will happily guide you through concepts on forums.

Maturing Ecosystem

There are over 50,000 crates to build upon, and more tools and IDE support is added frequently:

Crates.io growth

Image source: Programming Rust by Jim Blandy

You can find quality packages for almost every domain like web frameworks, data science, embedded programming and more.

The infrastructure around Rust improves constantly thanks to an engaged community.

7. Increasing Industry Adoption

Rust started as a personal project, but it has quickly gained mainstream appeal. Tech giants to startups have been adopting Rust.

Tech Giants Choose Rust

Companies like Microsoft, Google, Amazon, Dropbox, Cloudflare, and Facebook use Rust for mission-critical components:

  • Microsoft‘s Azure IoT Edge is built entirely in Rust for safety and performance.
  • Amazon‘s Firecracker VMMs for serverless computing are also written in Rust and replace C/C++ components.
  • Cloudflare migrated parts of the core edge logic to Rust which reduced memory bugs from 1 per month to 0.

Even Linux legend Linus Torvalds praised Rust, saying he hopes it replaces C one day. That‘s high praise!

Startups are Betting on Rust

Numerous startups are also choosing Rust to build their core products:

Rust allows these companies to create secure and robust applications without compromising on performance.

High Salaries for Rust Developers

As per the 2022 Hired report, the average Rust developer salary crosses $125,000 in the US, with senior engineers earning over $150,000.

Rust jobs are also in high demand, with companies struggling to hire qualified Rust engineers. There‘s a massive skills shortage.

So there are abundant opportunities for Rust developers across startups and tech giants alike.


Rust solves critical problems around systems programming – concurrency, safety, performance and developer productivity. With endorsements from tech legends like Linus Torvalds and adoption by leading companies, Rust represents the future of systems programming.

I hope this guide has showcased why Rust is worth your time. Do give it a try for your next project – you may just fall in love with Rust like I did!

Let me know if you have any other questions. I‘m happy to help fellow Rustaceans get started on this rewarding journey.

AlexisKestler

Written by Alexis Kestler

A female web designer and programmer - Now is a 36-year IT professional with over 15 years of experience living in NorCal. I enjoy keeping my feet wet in the world of technology through reading, working, and researching topics that pique my interest.