Skip to content

nithin-lang/glowing-barnacle

Repository files navigation

glowing-barnacle

Rust Programming Tutorial

Welcome to the Rust Programming Tutorial! 🚀
This repository contains examples and notes organized by chapters to help you learn Rust step-by-step, starting from primitive data types to complex collections and error handling.


📚 Chapters Overview

Chapter 1: Primitive Data Types

Understand the basic data types that Rust uses to handle:

  • Numbers (integers, floating-points)
  • Booleans
  • Characters

Chapter 2: Compound Data Types

Explore complex data structures:

  • Tuples — group multiple values of different types.
  • Arrays — fixed-size collections of elements of the same type.

Chapter 3: Functions

Learn how to define and use functions, and understand Rust's approach to:

  • Code organization
  • Code reuse

Chapter 4: Ownership

Dive into Rust's unique memory management system:

  • Manage resources safely without a garbage collector.
  • Understand how ownership works.

Chapter 5: Borrowing and References

Expand on memory safety:

  • Create references to variables without taking ownership.
  • Understand mutable and immutable borrowing.

Chapter 6: Variables and Mutability

Discover how Rust handles:

  • Immutable variables (by default)
  • Mutability when needed

Chapter 7: Constants

Work with constants:

  • Immutable by default
  • Never mutable after being set
  • Used for safe, fixed values

Chapter 8: Shadowing

Enhance flexibility in variable handling:

  • Redefine a variable with the same name.
  • Understand how shadowing differs from mutability.

Chapter 9: Comments

Master the art of documentation:

  • Write clear and useful comments.
  • Help future readers (and yourself) understand the code better.

Chapter 10: Introduction to Control Flow

Learn decision-making in Rust using:

  • if
  • else if
  • else statements

Chapter 11: Looping Mechanisms

Explore the three looping constructs:

  • loop — runs indefinitely until stopped.
  • while — runs while a condition holds true.
  • for — iterates over ranges, arrays, and collections efficiently.

Chapter 12: Defining Structs

Create your own complex types:

  • Bundle related data into structs.
  • Learn about immutability in structured data.

Chapter 13: Introduction to Enums

Work with enums:

  • Define a type by enumerating its possible values (variants).
  • Handle related types safely and cleanly.

Chapter 14: Error Handling Techniques

Understand Rust’s safe error-handling philosophy:

  • Use Result and Option types to manage errors and absence of values predictably.

Chapter 15: Collection Types

Manage groups of data efficiently using:

  • Vectors — dynamic arrays.
  • Strings — flexible, UTF-8 encoded text storage.
  • HashMaps — key-value pair storage for fast lookup.

🛠 How to Use This Repository

Each chapter folder contains:

  • Code examples
  • Notes and explanations
  • Practice problems (in some chapters)

You can navigate through the chapters sequentially or jump directly to the topic you want to learn.


✨ Getting Started

If you are new to Rust:

  1. Install Rust from https://rustup.rs/
  2. Use cargo run to run examples after navigating to a project folder.

📢 Contribution

Feel free to fork, modify, or suggest improvements!
Let's build a great resource for learning Rust together.


📄 License

This project is open-source and available under the MIT License.


Would you also like me to help you create a simple file/folder structure example for this repo (like /Chapter_01_Primitives/main.rs, etc.)? It can make it even easier for you to organize your GitHub repo. 🚀

About

Rust basics tutorial & examples by chapters!

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages