- Published on
Rust in 2025: 45.5% Adoption, TIOBE #13, Linux Kernel — Should Your Team Learn Rust?
- Authors

- Name
- Youngju Kim
- @fjvbn20031
- 1. Rust in 2025: The Numbers Tell the Story
- 2. Where Rust Is Used: A Complete Guide to Real-World Applications
- 3. Why Rust: Comparing Go, C++, and Java
- 4. Rust Learning Roadmap: An Honest Guide
- Week 1-2: Ownership, Borrowing, Lifetimes (The Hardest Gate)
- Week 3-4: Structs, Enums, Pattern Matching
- Month 2: Traits, Generics, Closures, Iterators
- Month 3: Async Programming (tokio), Web Frameworks
- Month 4+: unsafe, FFI, Macros, Optimization
- Recommended Learning Resources
- Realistic Learning Time Estimates
- 5. Rust's Challenges and the 41.6% Concern
- 6. Migrating from Go to Rust, C++ to Rust: Strategy Guide
- 7. 2025 Rust Ecosystem Highlights
- Practice Quiz
- References
1. Rust in 2025: The Numbers Tell the Story
2025 was a historic year for Rust. The transition from "interesting newcomer" to "enterprise-critical infrastructure language" was confirmed by the numbers.
Key Metrics Summary
Organizational Adoption: 45.5% (+17.6% YoY)
Primary Language Use: 38.2%
Commercial Use: 68.75% growth (vs. 2021)
TIOBE Ranking: #13 (all-time high)
Stack Overflow: 9 consecutive years "Most Admired Language"
crates.io Packages: 150,000+ (as of late 2024)
What 45.5% Organizational Adoption Means
Why does 45.5% matter? In 2023, this figure was 27.9%. A 17.6 percentage point increase in just two years signals that enterprise decision-makers are actively deploying Rust in production environments, not just experimenting with personal projects.
Year-over-Year Organizational Adoption:
2020: ~15%
2021: ~20%
2022: ~25%
2023: 27.9%
2024: 34.8%
2025: 45.5%
Explosive Growth in Commercial Use
In 2021, the percentage of respondents using Rust for "most of their work" was approximately 8%. By 2025, this figure reached 13.5%, recording a remarkable 68.75% growth rate. Notably, the percentage answering "I don't use Rust at work at all" has dropped dramatically.
The Significance of TIOBE #13
Rust reaching #13 on the TIOBE Index carries meaning beyond the raw ranking. For a relatively young systems programming language to achieve this position among legacy powerhouses like C, C++, Java, Python, and JavaScript is exceptional. In 2020, Rust was outside the top 30.
9 Consecutive Years at Stack Overflow
Rust has been selected as the "Most Admired Language" in the Stack Overflow Developer Survey for nine consecutive years from 2016 to 2024. In the 2024 survey, approximately 83% of developers who used Rust expressed desire to continue using it. This indicates overwhelmingly high satisfaction among experienced Rust developers.
2. Where Rust Is Used: A Complete Guide to Real-World Applications
The answer to "Who uses Rust?" is now crystal clear. The world's largest companies are actively adopting Rust for critical infrastructure.
Linux Kernel (Rust for Linux)
Since Rust was officially added as a supported language in Linux 6.1 in 2022, the Rust for Linux project has been steadily expanding.
// Traditional Linux kernel driver (C language)
// Risk of NULL pointer, buffer overflow and other memory bugs
static int my_driver_probe(struct platform_device *pdev) {
struct my_data *data;
data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL);
if (!data)
return -ENOMEM;
// ... manual memory management
}
// Kernel driver written in Rust
// Memory safety guaranteed at compile time
use kernel::prelude::*;
module! {
type: MyDriver,
name: "my_driver",
license: "GPL",
}
struct MyDriver {
// Ownership system ensures memory safety
}
impl kernel::Module for MyDriver {
fn init(_module: &'static ThisModule) -> Result<Self> {
pr_info!("Rust driver loaded\n");
Ok(MyDriver {})
}
}
Key Point: Approximately 70% of security vulnerabilities found in the Linux kernel are memory safety issues. Rust fundamentally solves this problem.
Android
Google is actively adopting Rust in Android.
- Bluetooth Stack: Rewriting the Gabeldorsche Bluetooth stack in Rust since Android 13
- WiFi Stack: Introducing Rust to core networking components
- Keystore2: Reimplementing Android's key management system in Rust
- UWB (Ultra-Wideband): Near-field communication stack
According to Google's reports, memory safety vulnerabilities noticeably decreased after introducing Rust for new code in Android.
AWS (Amazon Web Services)
AWS is one of the most active corporate sponsors of Rust.
Firecracker: Micro VM for serverless workloads (powers Lambda, Fargate)
Bottlerocket: Container-focused Linux-based OS
S2N-TLS: TLS protocol implementation
Mountpoint: File system client for S3
Cedar: Authorization policy language and engine
Firecracker is particularly noteworthy. As the core technology powering AWS Lambda and Fargate, it provides microsecond-level boot times with minimal memory overhead.
Cloudflare
Cloudflare is building infrastructure that handles a significant portion of internet traffic in Rust.
- Pingora: HTTP proxy framework replacing Nginx. Handles trillions of requests per day
- Edge Computing: Core components of the Workers runtime
- DNS Infrastructure: High-performance DNS processing
Pingora was open-sourced in 2024 and showed improvements in both memory usage and CPU usage compared to existing C-based solutions.
Discord
Discord's migration from Go to Rust is one of the most frequently cited success stories in the Rust community.
Service: Read States (read status tracking)
Problem: Latency spikes caused by Go's GC (Garbage Collector)
Result: After Go -> Rust migration:
- P99 latency improved by 10x
- Significant reduction in memory usage
- GC-related latency spikes completely eliminated
Meta (Facebook)
Meta is one of the early companies to adopt Rust at scale.
- Mononoke: Git-compatible source control server (used by tens of thousands of engineers)
- Buck2: Next-generation build system (entirely rewritten in Rust)
- Sapling: New source control client
- Relay: GraphQL compiler
Microsoft
Microsoft has begun introducing Rust into the Windows kernel.
- Windows Kernel: Transitioning some components like DWriteCore to Rust
- Azure: Parts of the IoT Edge runtime
- VS Code: Search functionality (based on ripgrep)
Microsoft's security team has revealed that approximately 70% of their product security vulnerabilities are memory safety issues, which is the primary motivation for Rust adoption.
Dropbox
Dropbox was one of the early adopters of Rust, writing core parts of their file sync engine in Rust.
- Sync Engine: Magic Pocket storage infrastructure
- Cross-Platform: Sharing the same Rust code across Windows, macOS, and Linux
Other Major Companies
1Password: Core password management logic
Figma: Multiplayer server
Vercel: Turbopack (next-generation bundler)
Shopify: YJIT (Ruby JIT compiler, written in Rust)
npm: Parts of registry infrastructure
3. Why Rust: Comparing Go, C++, and Java
To understand why you should choose Rust, comparing it with competing languages is essential.
Core Comparison Table
| Criteria | Rust | Go | C++ | Java |
|---|---|---|---|---|
| Memory Safety | Compile-time guarantee | GC-based | Manual management | GC-based |
| Performance | C/C++ level | Slightly slower | Top tier | JVM overhead |
| Concurrency Model | Compile-time verification | goroutines | Manual management | Thread-based |
| Learning Curve | Steep | Gentle | Very steep | Moderate |
| Build Speed | Slow | Very fast | Slow | Moderate |
| Binary Size | Small | Medium | Small | Large (JVM) |
| Ecosystem Maturity | Growing | Mature | Very mature | Very mature |
| Primary Domain | Systems, Infrastructure | Cloud, Microservices | Systems, Games | Enterprise |
Rust vs Go: When to Choose Which
Go and Rust are often compared, but their actual use cases differ considerably.
Choose Go when:
- Rapid development speed is the top priority
- Building microservices / API servers
- DevOps tooling (Kubernetes ecosystem)
- Team onboarding speed matters
- Prototyping with quick releases
Choose Rust when:
- Extreme performance is needed (P99 latency matters)
- Memory safety directly impacts security
- Systems programming (kernel, drivers)
- Predictable performance without GC
- Embedded / resource-constrained environments
Rust vs C++: Successor or Competitor?
// Rust: Compiler guarantees memory safety
fn process_data(data: &[u8]) -> Vec<u8> {
let mut result = Vec::new();
for &byte in data {
if byte > 0 {
result.push(byte * 2);
}
}
result
// Memory for result is automatically freed when going out of scope
}
// C++: Developer manually manages memory
std::vector<uint8_t> process_data(const uint8_t* data, size_t len) {
std::vector<uint8_t> result;
for (size_t i = 0; i < len; ++i) {
if (data[i] > 0) {
result.push_back(data[i] * 2);
}
}
return result;
// Could data be a dangling pointer? Compiler doesn't verify
}
Where Rust wins over C++:
- Compile-time memory safety
- Data race prevention
- Modern package manager (Cargo)
- Better error messages
Where C++ remains strong:
- Existing codebase size (decades of accumulation)
- Game engine ecosystem (Unreal Engine, etc.)
- Specific hardware/platform support
- Mature library ecosystem
Rust vs Java: A Different Dimension
Java and Rust target very different domains, but they compete in some areas.
Java's Strengths:
- Enterprise ecosystem (Spring, Jakarta EE)
- Vast libraries
- JVM optimizations (HotSpot)
- Abundant talent pool
Rust's Advantages (vs Java):
- Predictable latency without GC
- Much smaller binary / memory footprint
- Native compilation
- System-level access
4. Rust Learning Roadmap: An Honest Guide
Learning Rust is fundamentally different from learning other programming languages. Honestly speaking, the first two weeks are the most painful.
Week 1-2: Ownership, Borrowing, Lifetimes (The Hardest Gate)
These three concepts are the core of Rust and the point where most developers give up.
Ownership Basics
fn main() {
let s1 = String::from("hello");
let s2 = s1; // Ownership of s1 moves to s2
// println!("{}", s1); // Compile error! s1 is no longer valid
println!("{}", s2); // OK
}
Core Rules:
- Every value has exactly one owner
- When the owner goes out of scope, the value is freed
- Assigning a value to another variable moves ownership
Borrowing and References
fn main() {
let s1 = String::from("hello");
// Immutable borrow: multiple allowed
let len = calculate_length(&s1);
println!("'{}' length: {}", s1, len); // s1 still usable
// Mutable borrow: only one at a time
let mut s2 = String::from("hello");
change(&mut s2);
println!("{}", s2); // "hello, world"
}
fn calculate_length(s: &String) -> usize {
s.len()
}
fn change(s: &mut String) {
s.push_str(", world");
}
Borrowing Rules:
- Multiple immutable references are allowed simultaneously
- Only one mutable reference at a time
- Cannot have immutable and mutable references simultaneously
Lifetime Basics
// When lifetime annotations are needed
fn longest<'a>(x: &'a str, y: &'a str) -> &'a str {
if x.len() > y.len() {
x
} else {
y
}
}
fn main() {
let string1 = String::from("long string");
let result;
{
let string2 = String::from("xyz");
result = longest(string1.as_str(), string2.as_str());
println!("Longest string: {}", result);
}
// Using result here would cause an error (string2 already freed)
}
Learning Tip: Don't try to perfectly understand lifetimes from the start. Following compiler error messages and learning incrementally is the most effective approach.
Week 3-4: Structs, Enums, Pattern Matching
// Enums and pattern matching
enum Shape {
Circle(f64),
Rectangle(f64, f64),
Triangle(f64, f64, f64),
}
fn area(shape: &Shape) -> f64 {
match shape {
Shape::Circle(r) => std::f64::consts::PI * r * r,
Shape::Rectangle(w, h) => w * h,
Shape::Triangle(a, b, c) => {
let s = (a + b + c) / 2.0;
(s * (s - a) * (s - b) * (s - c)).sqrt()
}
}
}
// Error handling: Result and Option
fn divide(a: f64, b: f64) -> Result<f64, String> {
if b == 0.0 {
Err("Cannot divide by zero".to_string())
} else {
Ok(a / b)
}
}
fn main() {
match divide(10.0, 3.0) {
Ok(result) => println!("Result: {}", result),
Err(e) => println!("Error: {}", e),
}
// Concise with the ? operator
let result = divide(10.0, 0.0).unwrap_or(0.0);
println!("With default: {}", result);
}
Month 2: Traits, Generics, Closures, Iterators
// Trait definition and implementation
trait Summarizable {
fn summary(&self) -> String;
// Default implementation possible
fn preview(&self) -> String {
format!("{}...", &self.summary()[..20])
}
}
struct Article {
title: String,
content: String,
}
impl Summarizable for Article {
fn summary(&self) -> String {
format!("{}: {}", self.title, &self.content[..50])
}
}
// Generics and trait bounds
fn print_summary<T: Summarizable>(item: &T) {
println!("{}", item.summary());
}
// Iterators and closures
fn process_numbers(numbers: Vec<i32>) -> Vec<i32> {
numbers
.iter()
.filter(|&&n| n > 0)
.map(|&n| n * 2)
.collect()
}
Month 3: Async Programming (tokio), Web Frameworks
// Axum web server example
use axum::{routing::get, Router, Json};
use serde::Serialize;
#[derive(Serialize)]
struct User {
id: u64,
name: String,
}
async fn get_user() -> Json<User> {
Json(User {
id: 1,
name: "Alice".to_string(),
})
}
#[tokio::main]
async fn main() {
let app = Router::new()
.route("/user", get(get_user));
let listener = tokio::net::TcpListener::bind("0.0.0.0:3000")
.await
.unwrap();
axum::serve(listener, app).await.unwrap();
}
# Cargo.toml dependencies
[dependencies]
axum = "0.7"
tokio = { version = "1", features = ["full"] }
serde = { version = "1", features = ["derive"] }
serde_json = "1"
Month 4+: unsafe, FFI, Macros, Optimization
// unsafe block: use only when necessary
unsafe fn dangerous() {
// Raw pointer dereferencing, etc.
}
// FFI: Calling C libraries
extern "C" {
fn abs(input: i32) -> i32;
}
fn main() {
let result = unsafe { abs(-5) };
println!("Absolute value: {}", result);
}
// Declarative macros
macro_rules! vec_of_strings {
($($x:expr),*) => {
vec![$($x.to_string()),*]
};
}
fn demo() {
let names = vec_of_strings!["Alice", "Bob", "Charlie"];
println!("{:?}", names);
}
Recommended Learning Resources
Free Resources:
1. The Rust Programming Language (Official Book)
- https://doc.rust-lang.org/book/
- The most systematic introduction
2. Rustlings (Interactive Exercises)
- https://github.com/rust-lang/rustlings
- Learn by solving small problems
3. Rust by Example
- https://doc.rust-lang.org/rust-by-example/
- Example-driven learning
4. 100 Exercises To Learn Rust
- https://rust-exercises.com/
- Free course released in 2024
5. Comprehensive Rust (Google)
- https://google.github.io/comprehensive-rust/
- Google's internal training material, open-sourced
Paid/Advanced Resources:
6. Programming Rust, 2nd Edition (O'Reilly)
7. Rust in Action (Manning)
8. Zero To Production In Rust (web backend focused)
Realistic Learning Time Estimates
Estimated learning period by background:
- C/C++ developer: 2-3 months (quick to grasp memory model)
- Go developer: 3-4 months (needs to adapt to ownership)
- Java/C# developer: 4-5 months (adapting to GC-free environment)
- Python/JS developer: 5-6 months (systems programming + ownership)
- First programming language: Not recommended (learn another first)
5. Rust's Challenges and the 41.6% Concern
Rust is not without its challenges. Let's examine the key concerns revealed in the 2025 Rust survey.
Growing Complexity Concern (41.6%)
41.6% of Rust users are concerned about the "growing complexity of the language." Rust adds new features with every edition, making it increasingly difficult to keep up.
Key Concerns (2025 Survey):
1. Growing complexity: 41.6%
2. Insufficient adoption: 42.1%
3. Learning curve: (top complaint)
4. Compile times: (persistent issue)
5. Incomplete tooling: (IDE, debugger)
The Reality of the Learning Curve
Speaking frankly, Rust's learning curve is steep.
Ownership System (2-4 weeks): A concept you have never encountered in other languages. You will repeatedly experience the frustration of "Why won't this code compile?"
Lifetime Annotations (months): Understanding complex lifetime relationships requires real project experience. Theory alone has its limits.
Async Programming: Rust's async/await works differently from other languages. Concepts like Pin and Future require additional study.
// Showing why Rust's async is complex
// Unlike other languages, async function return types can be complicated
use std::future::Future;
fn make_request(url: &str) -> impl Future<Output = Result<String, reqwest::Error>> + '_ {
async move {
let response = reqwest::get(url).await?;
response.text().await
}
}
Compile Time Issues
Compile times remain a pain point for large Rust projects.
Approximate compile times by project size (clean build):
- Small (10K lines): 10-30 seconds
- Medium (100K lines): 2-5 minutes
- Large (500K+ lines): 10-30 minutes
Mitigation strategies:
- Use cargo check (type checking only, skips code generation)
- Cache with sccache
- Split workspaces
- Leverage incremental compilation
- Use cranelift backend (debug builds)
Ecosystem Maturity
The Rust ecosystem is growing rapidly, but some areas remain underdeveloped compared to Java or Python.
Mature Areas:
- Web frameworks (Axum, Actix)
- Serialization (serde)
- HTTP client (reqwest)
- CLI tools (clap)
- Async runtime (tokio)
Growing Areas:
- GUI (iced, egui - still early)
- ORM (diesel, sea-orm - evolving)
- Enterprise patterns (no unified framework like Spring)
- Machine learning (burn, candle - early stage)
Talent Shortage
Hiring Rust developers remains challenging. Supply lags behind demand, which is a double-edged sword in the job market.
Rust Developer Market:
- Demand: Surging (especially in infrastructure, security)
- Supply: Limited (small fraction of total developers)
- Average Salary: Upper tier (approximately 120-180K USD)
- Implication: Learning it boosts competitiveness, but team building is difficult
6. Migrating from Go to Rust, C++ to Rust: Strategy Guide
Rewriting an entire system in Rust all at once is almost always the wrong approach. Successful teams use incremental migration strategies.
Incremental Migration Principles
1. Start at the FFI Boundary
- Connect existing code with Rust via FFI
- Convert the riskiest parts (memory safety issues) to Rust first
- Start with performance-critical hot paths
2. Write New Services in Rust
- Keep existing code as-is
- Start new microservices in Rust
- Gradually expand the Rust footprint
3. Strangler Fig Pattern
- Build a new Rust layer wrapping the existing system
- Gradually shift traffic to the new layer
- Incrementally retire the old system
Migrating from Go to Rust
A practical guide based on Discord's case:
When to Migrate:
- GC-related latency spikes impact business
- P99 latency requirements are very strict
- Memory usage optimization is essential
- Repeated outages due to concurrency bugs
When NOT to Migrate:
- Go's performance is sufficient
- Team has zero Rust experience
- Rapid development speed is the top priority
- CRUD-centric business logic
// Go to Rust: HTTP Handler Comparison
// Go version (pseudocode for reference)
// func getUser(w http.ResponseWriter, r *http.Request) {
// id := r.URL.Query().Get("id")
// user, err := db.FindUser(id)
// if err != nil {
// http.Error(w, err.Error(), 500)
// return
// }
// json.NewEncoder(w).Encode(user)
// }
// Rust (Axum) version
use axum::{extract::Query, Json};
use serde::Deserialize;
#[derive(Deserialize)]
struct UserQuery {
id: String,
}
async fn get_user(Query(params): Query<UserQuery>) -> Result<Json<User>, AppError> {
let user = db::find_user(¶ms.id).await?;
Ok(Json(user))
}
Migrating from C++ to Rust
Step-by-Step Approach:
Step 1: Write new modules in Rust, connect via C++ FFI
Step 2: Establish test coverage (existing C++ code)
Step 3: Port the riskiest modules to Rust first
Step 4: Verify behavior with integration tests
Step 5: Gradually expand
FFI Tools:
- cxx: Safe FFI between C++ and Rust
- bindgen: Auto-generate Rust bindings from C/C++ headers
- cbindgen: Generate C/C++ headers from Rust
// Example of C++ interop using cxx
#[cxx::bridge]
mod ffi {
// Functions provided by the C++ side
unsafe extern "C++" {
include!("legacy/include/processor.h");
fn process_legacy_data(input: &[u8]) -> Vec<u8>;
}
// Functions provided by the Rust side
extern "Rust" {
fn validate_data(data: &[u8]) -> bool;
}
}
fn validate_data(data: &[u8]) -> bool {
// Safe validation logic in Rust
!data.is_empty() && data.len() < 1_000_000
}
Migration Checklist
Preparation:
[ ] Secure 1-2 Rust champions within the team
[ ] Build experience with a pilot project (2-3 months)
[ ] Measure performance baselines of the current system
[ ] Prioritize modules for migration
[ ] Add Rust build to CI/CD pipeline
Execution:
[ ] Design FFI interfaces
[ ] Write unit tests (Rust side)
[ ] Maintain integration tests (existing test suite)
[ ] Gradually shift traffic
[ ] Monitor and compare performance
Post-Migration:
[ ] Measure and document performance improvements
[ ] Create team training materials
[ ] Select next migration target
7. 2025 Rust Ecosystem Highlights
Here are the notable projects and trends in the 2025 Rust ecosystem.
Web Frameworks
Axum (developed by the tokio team):
- Perfect integration with the tokio ecosystem
- Tower middleware compatibility
- Type-safe routing
- Fastest growing Rust web framework in 2024-2025
Actix Web:
- Top-tier benchmark performance
- Mature ecosystem
- Multiple enterprise use cases
Loco.rs:
- Rails-style all-in-one framework
- Emerged in 2024, growing rapidly
- Focused on developer productivity
Games and Graphics
Bevy:
- Data-oriented game engine
- ECS (Entity Component System) architecture
- Rapidly growing community
- Not yet 1.0 but highly promising
wgpu:
- WebGPU implementation
- Cross-platform GPU programming
- Used in Firefox
Desktop Applications
Tauri:
- Electron alternative
- Web technologies (HTML/CSS/JS) + Rust backend
- Much smaller binary size (10-100x smaller than Electron)
- Significant memory usage reduction
- v2.0 released with mobile support
Dioxus:
- React-style Rust UI framework
- Web, desktop, and mobile support
WebAssembly (WASM)
Rust is the best partner for WebAssembly.
// Rust -> WASM example (using wasm-bindgen)
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
pub fn fibonacci(n: u32) -> u64 {
match n {
0 => 0,
1 => 1,
_ => {
let mut a: u64 = 0;
let mut b: u64 = 1;
for _ in 2..=n {
let temp = b;
b = a + b;
a = temp;
}
b
}
}
}
// Called from JavaScript:
// import { fibonacci } from './pkg/my_wasm';
// console.log(fibonacci(50));
Rust + WASM Use Cases:
- Figma: Core logic of the real-time collaborative editor
- Cloudflare Workers: Edge computing
- 1Password: Browser extension
- Amazon Prime Video: Video processing
- AutoCAD: Rendering engine for the web version
AI/ML Ecosystem
burn:
- PyTorch-style deep learning framework
- Multiple backend support (GPU, CPU, WASM)
- Pure Rust implementation
candle (Hugging Face):
- Lightweight ML inference framework
- Specialized for LLM inference
- Run ML models without Python dependencies
ort:
- Rust bindings for ONNX Runtime
- Suitable for production deployment of trained models
- Various hardware acceleration support
linfa:
- scikit-learn style traditional ML library
- Clustering, classification, regression, etc.
CLI Tool Ecosystem
CLI tools written in Rust are replacing traditional Unix tools.
Legacy Tool -> Rust Replacement:
grep -> ripgrep (rg)
find -> fd
cat -> bat
ls -> exa/eza
du -> dust
top -> bottom (btm)
sed -> sd
curl -> xh
diff -> delta
CLI Libraries:
- clap: Command-line argument parsing (de facto standard)
- ratatui: TUI (Terminal UI) framework
- indicatif: Progress bars
- dialoguer: Interactive prompts
Embedded / IoT
embassy:
- Async embedded framework
- async/await support in no_std environments
- Support for STM32, nRF, RP2040, and various MCUs
esp-rs:
- Rust support for ESP32 family MCUs
- Includes WiFi and Bluetooth
probe-rs:
- Debugging/flashing tool
- ARM and RISC-V support
Practice Quiz
Let's test what you've learned.
Q1. Under Rust's ownership rules, how many owners can simultaneously exist for a single value?
Answer: 1
In Rust's ownership system, every value can have exactly one owner. When you assign a value to another variable, ownership moves. This rule is the core mechanism that manages memory safely without a GC.
Q2. What was the primary reason Discord migrated from Go to Rust?
Answer: Latency spikes caused by the GC (Garbage Collector)
Go's GC was periodically causing latency spikes in Discord's Read States service. After migrating to Rust, P99 latency improved by 10x, and GC-related spikes were completely eliminated.
Q3. Why does the following Rust code produce a compile error?
let mut s = String::from("hello");
let r1 = &s;
let r2 = &mut s;
println!("{} {}", r1, r2);
Answer: Cannot have an immutable reference (r1) and mutable reference (r2) simultaneously
Under Rust's borrowing rules, you cannot create a mutable reference while an immutable reference exists. This rule prevents data races at compile time.
Q4. What is the name of the Rust-based technology that powers AWS Lambda and Fargate?
Answer: Firecracker
Firecracker is a micro VM monitor developed by AWS in Rust. It provides microsecond-level boot times and minimal memory overhead, and serves as the underlying technology for AWS Lambda and Fargate.
Q5. What is the mechanism in Rust for passing values to functions without transferring ownership?
Answer: Borrowing
Borrowing is the mechanism for accessing values through references (&) without transferring ownership. Immutable borrows (&T) allow multiple simultaneous references, while mutable borrows (&mut T) allow only one at a time.
References
-
Rust Survey 2024 Results - The Rust Foundation
-
TIOBE Index - TIOBE Software
-
Stack Overflow Developer Survey 2024
-
Rust for Linux Project
-
Memory Safety in Android
-
AWS and Rust
-
Cloudflare Pingora
-
Discord Blog - Why Discord is switching from Go to Rust
-
The Rust Programming Language (Official Book)
-
Rustlings
-
Comprehensive Rust by Google
-
Axum Web Framework
-
Tauri Framework
-
Bevy Game Engine
-
burn - Deep Learning Framework
-
candle - Hugging Face ML Framework
-
crates.io - Rust Package Registry
-
Are We Web Yet?
-
Rust Edition Guide