Skip to content
Learn Netverks

Lesson

Step 1/36 3% through track

intro

Introduction to Rust

Last reviewed May 28, 2026 Content v20260528
Track mode
server_compiled
Means
Compiled runner
Reading
~3 min
Level
beginner

This lesson

An orientation to the Rust track—how the server playground works, core vocabulary, and what you will practice next.

You need a clear map of the Rust track so ownership, borrowing, and the borrow checker do not feel like magic.

You will apply Introduction to Rust in contexts like: Infrastructure CLIs, proxies, game engines, blockchain nodes, and latency-sensitive backends.

Write Rust with fn main(), click Run on server—the dev runner compiles main.rs with rustc and runs the binary; fix borrow errors from stderr (requires Rust toolchain; LEARNING_RUNNER_ENABLED=true). Also read the interview prep blocks.

After HTML fundamentals and basic programming concepts—before or alongside SQL.

How this Rust track works

  • rustc in the playground — write a single file with fn main() and println!; the dev runner compiles with rustc and runs the binary. No Cargo in simple lessons.
  • Ownership is the core lesson — the compiler enforces memory safety at compile time. Borrow checker errors are normal while learning—read the message, fix one issue, re-run.
  • Prerequisites — finish JavaScript (functions, objects) and ideally Java or C++ for typed-systems context. Rust is not usually a first language.

Multi-crate Cargo projects, async runtimes, and WebAssembly builds run locally—lessons simulate patterns with println! where the sandbox is single-file.

Install on your device (macOS, Linux, Windows)

Install Rust via rustup for local cargo projects; playground compiles with rustc.

macOS

  1. curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh then restart terminal.
  2. Or brew install rustup-init && rustup-init

Linux

  1. Same rustup script: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
  2. Debian may need: sudo apt install -y build-essential curl first.

Windows

  1. Download rustup-init.exe from rustup.rs and run it (Visual Studio C++ build tools may be required).

Verify: rustc --version and cargo --version.

Run code on this site (Backend & language playgrounds)

  1. Clone or open this project locally; copy .env.example to .env.
  2. Ensure LEARNING_RUNNER_ENABLED=true and LEARNING_RUNNER_URL=http://127.0.0.1:9999/v1/execute.
  3. Terminal 1: php artisan serve (or composer run dev for Laravel + Vite + runner together).
  4. Terminal 2: npm run runner — keep it running while you click Run on server.

Rust is a systems programming language focused on memory safety without a garbage collector. It compiles to native machine code, runs without a runtime VM, and catches many bugs at compile time through ownership and types.

How this track differs from JavaScript and Java

After the JavaScript track, you know dynamic typing and garbage collection. After Java, you know static types and a JVM. Rust is statically typed like Java but has no GC—the compiler tracks who owns each value and when memory is freed.

Unlike scripting in the browser, Rust targets CLIs, servers, embedded systems, and WebAssembly. Expect the borrow checker to feel strict at first—that is the language teaching safe memory use.

What you will learn

  • Syntax: variables, types, control flow, functions, structs, enums, pattern matching
  • Ownership, borrowing, references, slices, and lifetimes basics
  • Collections, Result/Option, error handling, iterators
  • Traits, generics, modules, testing, concurrency intro, and Cargo workflow
  • Interview essentials, production habits, and a WebAssembly teaser

Playground setup

This topic uses the server_compiled profile: your code compiles with rustc as a single main.rs file. Use fn main() and println! for output. Cargo multi-file projects are taught for local development.

Self-check

  1. In one sentence, what makes Rust different from Java regarding memory?
  2. Why do we recommend prior programming experience before Rust?

Interview prep

What is Rust in one sentence?

A statically typed systems language that compiles to native code and enforces memory safety through ownership and borrowing—without a garbage collector.

Interview tip Lesson completion confidence

Can you explain this lesson in 30 seconds without reading notes?

Not saved yet.

Playground

Runs on the configured server runner (dev: npm run runner with LEARNING_RUNNER_ENABLED=true). Output appears below the editor.

Check yourself

Multiple choice — immediate feedback.

Discussion

Past discussion is visible to everyone. Only logged-in users can post comments and replies.

Starter discussion topics

  • Why Rust after JS/Java?
  • First CLI idea?

Sign up or log in to post comments and sync lesson progress across devices.

No discussion yet. Be the first to ask a question.

Jump