Prerequisites
9 min read
Before diving into Rust, let’s make sure you have the necessary background knowledge and tools. This will ensure a smooth learning experience.
Required Knowledge
Section titled “Required Knowledge”1. TypeScript/JavaScript Experience (Required)
Section titled “1. TypeScript/JavaScript Experience (Required)”You should be comfortable with:
Basic Programming
Section titled “Basic Programming”// Variables and typeslet name: string = "Alice";const age: number = 30;let isActive: boolean = true;
// Functionsfunction greet(name: string): string { return `Hello, ${name}!`;}
// Arrow functionsconst add = (a: number, b: number): number => a + b;Why it matters: These map directly to Rust concepts. If this looks unfamiliar, review JavaScript/TypeScript basics first.
Arrays and Objects
Section titled “Arrays and Objects”// Arraysconst numbers: number[] = [1, 2, 3, 4, 5];const doubled = numbers.map((n) => n * 2);const filtered = numbers.filter((n) => n > 2);
// Objects and interfacesinterface User { id: number; name: string; email: string;}
const user: User = { id: 1, name: "Alice", email: "alice@example.com",};Why it matters: Collections work similarly in Rust (Vec, HashMap, etc.)
Async/Await
Section titled “Async/Await”// Promises and async/awaitasync function fetchUser(id: number): Promise<User> { const response = await fetch(`/api/users/${id}`); const data = await response.json(); return data;}
// Error handlingtry { const user = await fetchUser(1); console.log(user);} catch (error) { console.error("Failed:", error);}Why it matters: Rust has async/await too, with similar (but not identical) syntax.
Generics
Section titled “Generics”// Generic functionsfunction first<T>(arr: T[]): T | undefined { return arr[0];}
// Generic interfacesinterface Response<T> { data: T; status: number;}
const userResponse: Response<User> = { data: user, status: 200,};Why it matters: Rust’s generics are similar but more powerful.
Modules and Imports
Section titled “Modules and Imports”// Importingimport { User, fetchUser } from "./api";import type { Config } from "./config";
// Exportingexport interface Product { id: number; name: string;}
export function getProducts(): Product[] { // ...}Why it matters: Rust’s module system is similar conceptually.
2. Command Line Basics (Required)
Section titled “2. Command Line Basics (Required)”You should know how to:
# Navigate directoriescd ~/projectslspwd
# Create files and directoriesmkdir my-projecttouch file.txt
# Run commandsnode app.jsnpm installnpm start
# View file contentscat README.md
# Basic gitgit clone <url>git add .git commit -m "message"Why it matters: You’ll use terminal commands for Cargo and rustc.
3. Development Tools (Required)
Section titled “3. Development Tools (Required)”Text Editor/IDE
Section titled “Text Editor/IDE”You need a text editor. Recommended options:
VS Code (Most popular)
# Install VS Code# Then install rust-analyzer extensioncode --install-extension rust-lang.rust-analyzerOther options:
- IntelliJ IDEA with Rust plugin
- Vim/Neovim with rust.vim
- Emacs with rust-mode
- Sublime Text with Rust Enhanced
Why it matters: You’ll write lots of Rust code!
Terminal/Shell
Section titled “Terminal/Shell”- macOS/Linux: Built-in terminal
- Windows: PowerShell, WSL2, or Git Bash
Helpful but Not Required
Section titled “Helpful but Not Required”Nice to Have
Section titled “Nice to Have”System Programming Concepts
Section titled “System Programming Concepts”If you’ve heard of these, great! If not, don’t worry, we’ll explain:
- Stack vs Heap - We’ll teach you
- Pointers - Rust handles them safely
- Memory management - Rust’s ownership system makes it easier
- Compilation - You’ll learn as you go
Other Compiled Languages
Section titled “Other Compiled Languages”Experience with these helps but isn’t necessary:
- C, C++, Go, Java, C#, Swift, Kotlin
If you have: Great! Some concepts will feel familiar
If you don’t: Perfect! You’ll learn Rust’s way without bad habits
What You DON’T Need
Section titled “What You DON’T Need”You Don’t Need to Know
Section titled “You Don’t Need to Know”Computer Science degree - Nope! Low-level programming - We’ll teach you C or C++ - Actually better if you don’t (fewer preconceptions) Assembly - Not at all Operating systems - Helpful but not required Math - Just basic programming logic
You Don’t Need to Be
Section titled “You Don’t Need to Be”A “10x developer” - Everyone starts somewhere A CS major - Self-taught? Perfect! Young - Age doesn’t matter A native English speaker - Code is universal
System Requirements
Section titled “System Requirements”Operating System
Section titled “Operating System”Rust works on:
- Linux (any distro)
- macOS (10.7+)
- Windows (7+, but 10+ recommended)
- BSD, etc.
Note for Windows users: Consider using WSL2 for a better experience. Or use PowerShell/CMD - both work fine.
Hardware
Section titled “Hardware”Minimum:
- 2 GB RAM (4 GB recommended)
- 2 GB disk space
- Any processor from the last 10 years
Why it matters: Rust compilation can be slow on old hardware.
Internet Connection
Section titled “Internet Connection”Required for:
- Installing Rust
- Downloading dependencies (crates)
- Accessing documentation
Tip: Once you’ve downloaded crates, you can work offline.
Required Software
Section titled “Required Software”1. Node.js (for TypeScript examples)
Section titled “1. Node.js (for TypeScript examples)”# Check if installednode --version # Should be 14+npm --version # Should be 6+
# If not installed: https://nodejs.org/Why: We’ll compare TypeScript and Rust code side-by-side.
2. TypeScript (optional but recommended)
Section titled “2. TypeScript (optional but recommended)”# Install globallynpm install -g typescript
# Verifytsc --versionWhy: To run the TypeScript examples in this guide.
3. Git (recommended)
Section titled “3. Git (recommended)”# Check if installedgit --version
# If not installed: https://git-scm.com/Why: For cloning examples and managing your code.
Pre-Learning Checklist
Section titled “Pre-Learning Checklist”Before starting Section 01, verify:
Knowledge Checklist
Section titled “Knowledge Checklist”- I can write TypeScript functions with type annotations
- I understand async/await and Promises
- I’ve used generics (
Array<T>,Promise<User>) - I know basic terminal commands (cd, ls, mkdir)
- I’ve built at least one TypeScript/JavaScript application
Tools Checklist
Section titled “Tools Checklist”- I have a text editor/IDE installed
- I can open and use a terminal
- I have Node.js installed (node —version works)
- I have Git installed (optional but recommended)
- I have at least 2 GB free disk space
Mindset Checklist
Section titled “Mindset Checklist”- I’m ready to invest 20+ hours learning
- I’m okay with compiler errors (they’re helpful!)
- I’m willing to think differently about programming
- I’m patient with myself as I learn
- I’m excited to learn Rust!
Quick Self-Assessment
Section titled “Quick Self-Assessment”Test Your TypeScript Knowledge
Section titled “Test Your TypeScript Knowledge”Try to answer these without looking them up:
Question 1:
const numbers = [1, 2, 3, 4, 5];const result = numbers.map((n) => n * 2).filter((n) => n > 5);What is result?
Answer
[6, 8, 10] - Numbers doubled, then filtered to only values > 5
Question 2:
interface User { name: string; age?: number;}What does the ? mean?
Answer
Optional property - age may or may not be present
Question 3:
async function fetchData(): Promise<string> { const response = await fetch("/api/data"); return response.text();}What does this function return?
Answer
A Promise<string> - The function is async, so it always returns a Promise
Scoring:
- 3/3: Perfect! You’re ready
- 2/3: Good, review weak areas
- 1/3 or less: Review TypeScript basics first
Recommended Pre-Reading (Optional)
Section titled “Recommended Pre-Reading (Optional)”If you want to prepare even more:
For TypeScript Review
Section titled “For TypeScript Review”For Programming Concepts
Section titled “For Programming Concepts”- JavaScript.info - Modern JavaScript
- MDN Web Docs - Web APIs
For Command Line
Section titled “For Command Line”Ready to Install Rust?
Section titled “Ready to Install Rust?”If you’ve checked all the boxes above, you’re ready!
What’s Next?
Section titled “What’s Next?”- You’ve verified prerequisites
- Next: Section 01 - Getting Started
- Install Rust and write your first program!
Still Not Sure?
Section titled “Still Not Sure?”Common Concerns
Section titled “Common Concerns”“I’ve only used JavaScript, not TypeScript.” → That’s okay! You’ll learn TypeScript concepts as we compare to Rust. Just note that examples use TypeScript syntax.
“I’ve never compiled a program before.” → Perfect! We’ll walk you through it. Compilation is just turning code into an executable.
“The terminal scares me.” → Don’t worry! We’ll explain every command. You’ll be comfortable with it soon.
“I don’t have much time.” → Start with 30 minutes a day. Progress is progress!
“What if I get stuck?” → Join the Rust Discord - the community is super helpful!
“Am I too old/young/etc. to learn Rust?” → Absolutely not! If you can write TypeScript, you can learn Rust.
You’re All Set!
Section titled “You’re All Set!”You have the knowledge and tools needed. Time to write some Rust!