Why Rust for something so simple?
At first glance, using Rust for a basic BMI calculator might seem excessive. Why choose a language known for its complexity and rigor for such a simple task? The answer lies precisely in that simplicity.
Rust isn’t just about safety and memory management. It’s a philosophy. Writing code in Rust means taking responsibility for every detail, even when the task appears trivial. In this project, Rust becomes the ideal tool to show that even a minimal application can be built with precision, respect for the user, and structural clarity.
By choosing Rust, we wanted to demonstrate that quality doesn’t depend on the size of the project, but on the intention behind it. A BMI calculator doesn’t have to be merely functional — it can be elegant, reliable, and thoughtfully designed. And Rust gently forces us to do exactly that.
Chapter Goal
This module walks you through setting up your Rust development environment, creating the project structure, and learning how to compile and run your first program. No prior experience required — we’re truly starting from zero.
Installing Rust
Rust is installed via rustup, the official toolchain installer that manages the compiler (rustc), the package manager (cargo), and updates.
Official site: https://www.rust-lang.org/tools/install
License: Free and open-source
Installation Steps
Windows (PowerShell):
iwr -useb https://sh.rustup.rs | iex
macOS / Linux (Terminal):
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
After installation, restart your terminal and verify:
rustc --version
cargo --version
Choosing Your Editor or IDE
You can write Rust in any text editor, but some tools offer a smoother experience thanks to dedicated support.
| Editor / IDE | Download Link | License | Key Features |
|---|---|---|---|
| Visual Studio Code | https://code.visualstudio.com | Free | Lightweight, extensible, excellent Rust support |
| CLion | https://www.jetbrains.com/clion | Paid (with free trial) | Full-featured IDE, Rust support via plugin |
| Zed | https://zed.dev | Free | Minimalist, fast, great for Rust |
Recommended extension for VS Code:
rust-analyzer
Creating the Project
Rust uses cargo to manage projects, dependencies, and compilation. To start:
cargo new bmi_calculator
cd bmi_calculator
This command generates a basic structure:
bmi_calculator/
├── Cargo.toml # Project configuration
└── src/
└── main.rs # Program entry point
Compiling and Running
To compile and run the program:
cargo run
To compile without running:
cargo build
To run any tests:
cargo test
Verifying Your Setup
Open src/main.rs and write:
fn main() {
println!("Hello Rust!");
}
Save and run cargo run. If you see “Hello Rust!” in your terminal, you’re ready for the next chapter.
Disclaimer
This course is intended for educational and demonstrative purposes. Instructions and links are accurate at the time of writing but may change over time. Always refer to official sources for the latest updates. Use of third-party software is subject to the terms and licenses of their respective providers.
