Skip to content

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.


1. TypeScript/JavaScript Experience (Required)

Section titled “1. TypeScript/JavaScript Experience (Required)”

You should be comfortable with:

// Variables and types
let name: string = "Alice";
const age: number = 30;
let isActive: boolean = true;
// Functions
function greet(name: string): string {
return `Hello, ${name}!`;
}
// Arrow functions
const 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
const numbers: number[] = [1, 2, 3, 4, 5];
const doubled = numbers.map((n) => n * 2);
const filtered = numbers.filter((n) => n > 2);
// Objects and interfaces
interface 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.)

// Promises and async/await
async function fetchUser(id: number): Promise<User> {
const response = await fetch(`/api/users/${id}`);
const data = await response.json();
return data;
}
// Error handling
try {
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.

// Generic functions
function first<T>(arr: T[]): T | undefined {
return arr[0];
}
// Generic interfaces
interface 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.

// Importing
import { User, fetchUser } from "./api";
import type { Config } from "./config";
// Exporting
export interface Product {
id: number;
name: string;
}
export function getProducts(): Product[] {
// ...
}

Why it matters: Rust’s module system is similar conceptually.


You should know how to:

Terminal window
# Navigate directories
cd ~/projects
ls
pwd
# Create files and directories
mkdir my-project
touch file.txt
# Run commands
node app.js
npm install
npm start
# View file contents
cat README.md
# Basic git
git clone <url>
git add .
git commit -m "message"

Why it matters: You’ll use terminal commands for Cargo and rustc.


You need a text editor. Recommended options:

VS Code (Most popular)

Terminal window
# Install VS Code
# Then install rust-analyzer extension
code --install-extension rust-lang.rust-analyzer

Other 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!

  • macOS/Linux: Built-in terminal
  • Windows: PowerShell, WSL2, or Git Bash

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

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


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

A “10x developer” - Everyone starts somewhere A CS major - Self-taught? Perfect! Young - Age doesn’t matter A native English speaker - Code is universal


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.

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.

Required for:

  • Installing Rust
  • Downloading dependencies (crates)
  • Accessing documentation

Tip: Once you’ve downloaded crates, you can work offline.


Terminal window
# Check if installed
node --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.

Terminal window
# Install globally
npm install -g typescript
# Verify
tsc --version

Why: To run the TypeScript examples in this guide.

Terminal window
# Check if installed
git --version
# If not installed: https://git-scm.com/

Why: For cloning examples and managing your code.


Before starting Section 01, verify:

  • 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
  • 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
  • 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!

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

If you want to prepare even more:


If you’ve checked all the boxes above, you’re ready!

  1. You’ve verified prerequisites
  2. Next: Section 01 - Getting Started
  3. Install Rust and write your first program!

“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 have the knowledge and tools needed. Time to write some Rust!