108 Days of Rust: My Journey to Mastering Systems Programming

Venkat Annangi
Venkat Annangi
13/09/2024 07:23 8 min read 101 views
#webdevelopment #systemsprogramming #rust #concurrency #108 days of rust

Introduction: Why I’m Doing This

Rust has quickly become one of the most talked-about programming languages in the world. Known for its focus on memory safety, speed, and concurrency, Rust offers the perfect balance between performance and developer productivity. As someone who enjoys learning new programming paradigms, I decided to take on the 108 Days of Rust challenge, committing to learning, practicing, and building with Rust every day.

Through this journey, I’ll be exploring the nuances of Rust, from its unique ownership system to its highly efficient concurrency model. By the end of these 108 days, my goal is to not only be proficient in Rust but to have built several real-world projects showcasing its power in systems programming and web development.

In this post, I’ll outline my plan for the 108 days, including the first few days of learning, which I’ve already completed. Each day, I’ll explore new concepts and document my progress, making this both a personal learning experience and a resource for others who want to start learning Rust.


The First 4 Days of Rust

Here’s a look at how my first few days with Rust have gone so far:


Days 5–9: Exploring Rust’s Core Data Types

The next few days will focus on mastering Rust’s memory safety features, particularly ownership, borrowing, and Rust’s rich set of data types. I’ll explore how Rust ensures safe memory access and prevents data races, along with the core data types for building safe systems.


Days 11–15: Complex Data Types – Tuples, Arrays, Vectors, Enums and Structs 

Once I’m comfortable with Rust’s basic types, I’ll dive into more complex data structures like tuples, arrays, and vectors. I’ll explore their performance, practical uses, and common pitfalls.


Days 16–20: Advanced Rust Features

  • Day 16: Pattern Matching in Rust – Powerful Control Flow with Match
  • Day 17: Traits in Rust – Defining Shared Behavior for Types
  • Day 18: Generics in Rust – Writing Flexible and Reusable Code
  • Day 19: Lifetimes in Rust – Understanding and Managing Borrowing
  • Day 20: Smart Pointers – Box, Rc, and RefCell

Days 21–30: Ownership, Borrowing, and Lifetimes

  • Day 21: Ownership in Rust – Core Concepts and Memory Safety
  • Day 22: Borrowing and References – Understanding Rust’s Borrowing Rules
  • Day 23: Lifetime Annotations – Managing Borrowing and Scopes
  • Day 24: The Borrow Checker – How Rust Ensures Memory Safety
  • Day 25: Stack vs Heap – Memory Allocation in Rust
  • Day 26: Shared Ownership with Rc and Arc
  • Day 27: Interior Mutability with RefCell and Mutex
  • Day 28: Concurrency with Rust – Using Threads Safely
  • Day 29: Asynchronous Programming in Rust – async/await Basics
  • Day 30: Common Pitfalls and Best Practices for Ownership and Borrowing

Days 31–40: Advanced Rust Memory and Patterns

  • Day 31: Advanced Pattern Matching in Rust – Beyond Basic Match
  • Day 32: Memory Management in Rust – Box, Rc, and Arc in Complex Scenarios
  • Day 33: Working with Unsafe Rust – When to Use and How to Use it Safely
  • Day 34: Foreign Function Interface (FFI) – Interacting with Other Languages
  • Day 35: Zero-Cost Abstractions in Rust – How Rust Optimizes Code
  • Day 36: Rust Macros – Declarative and Procedural Macros
  • Day 37: Procedural Macros – Writing Code That Writes Code
  • Day 38: Error Handling in Large Projects – Advanced Error Propagation
  • Day 39: Using Phantom Types for Safer Rust Code
  • Day 40: Advanced Lifetimes and Borrowing Across Threads

Days 41–50: Error Handling in Rust

  • Day 41: Result and Option Types in Depth – Handling Complex Errors
  • Day 42: Combining Multiple Error Types – Building Comprehensive Error Models
  • Day 43: The ? Operator and Error Propagation in Complex Applications
  • Day 44: Creating Custom Error Types with Traits
  • Day 45: Error Handling in Async Code – Managing Errors in Async/Await
  • Day 46: Recovering from Failures – Using Backoff Strategies
  • Day 47: Logging and Error Monitoring in Rust
  • Day 48: Building Error Handling Libraries in Rust
  • Day 49: Best Practices for Handling Errors in Production Systems
  • Day 50: Testing Error Paths in Rust – Writing Robust Error Tests

Days 51–60: Rust Traits and Generics

  • Day 51: Advanced Trait Bounds – Using Multiple Traits in a Generic Context
  • Day 52: Trait Objects and Dynamic Dispatch – Using Traits at Runtime
  • Day 53: Associated Types and Default Implementations for Traits
  • Day 54: Higher-Kinded Types and Advanced Generics in Rust
  • Day 55: Implementing Complex Trait Combinations – Using Generics Effectively
  • Day 56: Traits and Lifetimes – Handling References with Trait Bounds
  • Day 57: Blanket Implementations for Generic Types
  • Day 58: Combining Traits with Async and Concurrency in Rust
  • Day 59: Generic Programming Patterns – Implementing Flexibility
  • Day 60: Using PhantomData for Generic Types

Days 61–70: Concurrency in Rust

  • Day 61: Multithreading in Rust – An Introduction to Safe Threading
  • Day 62: Channels and Message Passing in Rust – Communicating Between Threads
  • Day 63: Using Mutex and Arc for Safe Shared State
  • Day 64: Building Actor Systems in Rust for Concurrent Workflows
  • Day 65: Writing Concurrent Servers in Rust – Using Tokio and async-std
  • Day 66: Understanding Rust’s Memory Model in Concurrency
  • Day 67: Async Programming with Futures and Streams in Rust
  • Day 68: Combining async/await with Channels and Message Passing
  • Day 69: Handling Errors in Concurrent Code – Strategies for Resilience
  • Day 70: Performance Considerations for Concurrent Rust Applications

Days 71–80: Collections, Iterators, and Closures

  • Day 71: Vec, HashMap, and HashSet – The Backbone of Rust Collections
  • Day 72: Creating Custom Collections in Rust
  • Day 73: Working with Iterators and Iterator Adapters for Efficiency
  • Day 74: Understanding Lazy Evaluation in Rust with Iterators
  • Day 75: Closures in Rust – Using Functions as First-Class Citizens
  • Day 76: Higher-Order Functions with Closures – Advanced Functional Programming
  • Day 77: Working with References and Lifetimes in Closures
  • Day 78: Using Iterator and Closure Combinations for Data Processing
  • Day 79: Parallel Iteration in Rust – Combining Iterators with Rayon
  • Day 80: Performance Considerations for Collections and Iterators

Days 81–90: Macros and Unsafe Rust

  • Day 81: Declarative Macros – Understanding Macro Rules and Pattern Matching
  • Day 82: Procedural Macros – Writing Code That Writes Code
  • Day 83: Using Macros for Code Reuse and Abstraction
  • Day 84: Safe Use of Unsafe Rust – When and Why to Use Unsafe
  • Day 85: Memory Safety in Unsafe Code – Managing Pointers and Buffers
  • Day 86: Building Safe APIs Over Unsafe Rust
  • Day 87: Rust’s Foreign Function Interface (FFI) – Calling External Code
  • Day 88: Interfacing with C and Other Languages in Rust
  • Day 89: Advanced Macros – Procedural Macros with Complex Patterns
  • Day 90: Contributing to Rust’s Unsafe Code Guidelines

Days 91–108: Building Real-World Applications

  • Day 91: Building CLI Tools with StructOpt and Clap in Rust
  • Day 92: Creating a Basic Web Server with Actix or Rocket
  • Day 93: Writing Testable Code and Benchmarks for Your Rust Project
  • Day 94: Building a Real-Time Application with WebSockets in Rust
  • Day 95: Using Rust for Game Development – Basics of Bevy
  • Day 96: Creating a Microservice Architecture in Rust
  • Day 97: Implementing a Database Layer with Diesel or SQLx
  • Day 98: Packaging and Distributing Your Rust Application
  • Day 99: Contributing to Open-Source Rust Projects
  • Day 100: Final Project – Build a Complete Application in Rust (Web App, CLI Tool, etc.)
  • Day 101-108: Refining and Optimizing the Final Project – From Prototype to Production

Conclusion: The Road Ahead

Rust is a challenging but rewarding language, and I’m excited to continue my journey over the next 108 days. By taking on this challenge, I hope to not only master Rust but also inspire others to dive into this incredible language. Whether you’re just starting out with Rust or are an experienced developer, I encourage you to join me on this journey, learn alongside me, and see what Rust can do!

Comments