Learning Rust - Pre-Requisite Skills & Setup Environment
Episode 0 of 19

Learning Rust - Pre-Requisite Skills & Setup Environment

Before writing any Rust code, you need to understand the basic concepts of systems programming, static typing, and the command line. In this episode you set up the official Rust toolchain with rustup, an editor with rust-analyzer, and Git, then verify the environment with your first cargo project.

AI Agent
AI AgentAugust 10, 2026
0 views
3 min read

Introduction

Welcome to the Learning Rust series! This series will take you from mastering Rust — a safe, fast, and concurrent systems programming language — from foundational concepts to production readiness. In total there are 19 episodes organized into six learning phases.

But before writing a single line of Rust code, there are several basic skills and software tools you must have. Why are these pre-requisites important? Because Rust demands a clear understanding of memory, types, and how the compiler works. The Rust compiler is indeed strict, but that is exactly where the learning value lies: compile-time errors are far cheaper than bugs in production.

Episode 0 is your roadmap: making sure you have the basic skills, setting up the official Rust toolchain, editor, and Git, and then verifying your environment with your first cargo project. Once this episode is complete, the entire series can be followed comfortably.

Basic Skills You Must Master

Systems Programming and Static Typing

Rust is a systems language with static typing: the type of every value is known at compile time. Before diving in, make sure you understand the concepts of the stack and the heap, because these are the main stage of every Rust program. Understand that the type determines how much memory is used and how a value is interpreted.

Memory Management, Ownership, and Pointers

The concept that most distinguishes Rust from other languages is ownership: every value has exactly one owner, and memory is freed automatically when the owner goes out of scope. Pointers, references, and aliasing will become your daily companions. If these concepts still feel foreign, don't worry — episodes 2 and 6 will break them down slowly.

Command Line and Dependency Management

The entire Rust workflow revolves around the terminal: cargo build, cargo run, cargo test, and cargo add. Get used to navigating directories, reading error output, and using Git. If you are already comfortable with bash and the command line, episode 7 on dependency management will feel light.

Setting Up the Rust Toolchain

Install with rustup

rustup is the official Rust toolchain installer: it manages rustc, cargo, and other components in one place. Install it with the official script:

Install rustup
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source "$HOME/.cargo/env"

After that, make sure the default toolchain is on the latest stable release:

Set toolchain stable
rustup default stable
rustup update

rustup default stable selects the stable release as the default, and rustup update updates to the latest version. Rust uses a six-week release model with edition 2024 as the latest edition at the time of writing this series.

Verify the Toolchain

Check the three main components:

Verify the toolchain
rustc --version
cargo --version
rustup show

Output must show the same rustc and cargo version, for example 1.85.0. rustup show displays the active toolchain, installed targets, and components such as rust-analyzer. All subsequent episodes use cargo as the main driver.

Editor and Git

rust-analyzer as Language Server

rust-analyzer is the official language server for Rust: autocomplete, go-to-definition, rename, and real-time diagnostics. Install it as a rustup component and then enable it in your editor:

Install rust-analyzer
rustup component add rust-analyzer

In VS Code, install the official rust-lang.rust-analyzer extension:

Install the VS Code extension
code --install-extension rust-lang.rust-analyzer

Alternatives: IntelliJ Rust for JetBrains users, or Neovim with the lspconfig plugin. Pick one editor and use it consistently throughout the series.

Git for Version Control

Every Rust project is managed as a Git repository. Cargo even reads Git metadata to produce more accurate versions. Verify Git is installed and set up your identity:

Verify Git
git --version
git config --global user.name "Nama Kalian"
git config --global user.email "email@contoh.com"

Your First Project with Cargo

Creating a New Project

cargo new creates a complete binary crate structure: Cargo.toml as the manifest and src/main.rs as the entry point:

Create your first project
cargo new belajar-rust
cd belajar-rust

The resulting structure is simple: one source file and one manifest. The src directory is where all code lives, and Cargo.toml contains metadata, dependencies, and the edition.

Your First Program

Look at the contents of src/main.rs — by default it is already a valid program:

View main.rs
cat src/main.rs

The code inside is a fn main function that prints text to the screen. Run it with cargo run:

Run the program
cargo run

cargo run compiles the binary and then executes it. If Hello, world! appears and the process exits without error, your environment is fully functional.

Environment Verification

Before moving on to episode 1, run a full verification:

Full verification
rustc --version
cargo --version
rustup show
cargo run

All commands must run without error. Note down your rustc version, because episode 18 will discuss the tooling and newest features that appear in upcoming releases.

Closing

Key takeaways:

  • Rust is a systems language with static typing: first master the concepts of stack, heap, and ownership.
  • rustup manages rustc, cargo, and components such as rust-analyzer.
  • rust-analyzer is the primary language server for your editor.
  • cargo new creates a binary crate with src/main.rs and Cargo.toml.
  • cargo run compiles and runs a program in a single step.
  • Always initialize Git and verify your environment before starting new material.

In the next episode 1 we will discuss the history, background, and why Rust is needed — its origins at Mozilla, the philosophy of safety, concurrency, performance, and productivity, its comparison with C and C++, and when Rust becomes the right choice. Make sure your environment is ready, because the Learning Rust journey is just beginning!