Exploring Rust: Notes from a Beginner's Journey
Table of contents
This blog acts as my personal notes while I read through The Rust Programming Language book available on the official Rust website. Think of it as a condensed version of the official guide, designed 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.
- Install Rust via
rustup
:
curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf | sh
- Install a linker:
xcode-select --install
- Verify the Rust installation:
rustc --version # Check Rust version
echo $PATH # Confirm Rust is added to the PATH
- 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. 🚀
Subscribe to my newsletter
Read articles from Abindran R directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by