Exploring Rust: Notes from a Beginner's Journey

This blog serves as my personal notes as I read through The Rust Programming Language book available on the official Rust website. Consider it a condensed version of the official guide, tailored for easy reference.

If you've installed Rust using rustup, the Rust book is also available offline. You can access it using the command:

rustup doc --book
At the time of writing this blog, I am using Rust version:
rustc 1.80.1 (3f5fd8dd4 2024-08-06)

Why Rust?

Rust is known for its speed, thanks to its lack of a garbage collector

. Most common programming errors are caught during the compilation

stage, significantly reducing both syntactical and logical issues.

However, achieving the desired program outcome still depends on the

logic you implement—so if something doesn't work as expected,

don't blame Rust!

Tools in Rust

Here are some essential tools for working with Rust:

  • Cargo: Rust's package manager, similar to npm in JavaScript.
  • Rustfmt: A tool for automatic code formatting.
  • rust-analyzer: Provides code completion and inline error messages in IDEs.

Installing Rust on macOS

Follow these steps to set up Rust on macOS. For other operating systems, refer to the official Rust book.

  1. Install Rust via rustup:

    curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf | sh
  2. Install a linker:

    xcode-select --install
  3. Verify the Rust installation:

    rustc --version # Check Rust version echo $PATH # Confirm Rust is added to the PATH
  4. Update or uninstall Rust as needed:

    rustup update # To update Rust rustup self uninstall # To uninstall Rust

What's Next?

In the upcoming post, I’ll cover getting started with Rust, including running your first "Hello, World!" program.

Until then, signing off! See you in the next blog post of the Rust series. 🚀

Comments