Free course · for C programmers

Rust for C Developers

Map malloc/free, pointers, errno, tagged unions and make onto ownership, borrows, Result, enums and Cargo

You already know how memory, pointers and a compiler work. Each lesson puts a C habit next to its Rust equivalent, names exactly what changes, and asks you to port the C function to Rust. Undefined behaviour in the C examples was confirmed with sanitizers, and every Rust example was compiled and run.

5 units · 20 lessons · covers 32 Academy lessons · complete lessons free without registration

Rust at a glance

What stays the same, what safe Rust rules out, and how to read rustc

Familiar syntax, different defaults

printf, const, integer rules, expressions and loops

Memory without malloc and free

Owners, borrows, slices and lifetimes instead of conventions

Data, absence and errors

Methods, tagged unions, NULL, errno and text

Build, unsafe, FFI and threads

Cargo, the unsafe boundary and data-race-free threads

Skip what you already know

Each lesson here teaches and checks the rule of the Academy lessons next to it. After this course, continue with the lessons it does not cover.

This courseAcademy lessons it covers
What Rust Is, from CWhat Rust Is (Rust Basics)
Reading rustc DiagnosticsReading rustc (Rust Basics)
From printf to println!Hello, Rust (Rust Basics), Printing Values (Rust Basics)
const by DefaultVariables (Rust Basics)
Integer Overflow and CastsNumbers (Rust Basics), Operators & Casting (Rust Basics)
Functions Are ExpressionsFunctions (Rust Basics), Block Expressions (Rust Basics)
From for(;;) to RangesLoops (Rust Basics), Ranges (Rust Basics)
From malloc/free to OwnershipOwnership (Ownership Mastery), Drop & Scope (Ownership Mastery)
Pointers to ReferencesFirst References (Rust Basics), Borrowing (Ownership Mastery)
Pointer + Length to SlicesSlices (Ownership Mastery)
Dangling Pointers and LifetimesLifetime Intuition (Ownership Mastery)
Struct Copies: Copy and CloneCopy & Clone (Ownership Mastery)
Structs and MethodsStructs (Rust Basics), Using Methods (Rust Basics)
Tagged Unions to EnumsEnums & Match (Rust Basics), Pattern Matching (Rust Basics)
NULL and errno to Option and ResultOption & Result (Rust Basics), Handling Failure (Rust Basics)
char Arrays to StringsStrings & UTF-8 (Rust Basics), Characters & Text (Rust Basics)
Headers and make to CargoModules (Cargo & Real Projects), Package Layout (Cargo & Real Projects)
unsafe, Raw Pointers and FFIunsafe Rust (Macros & Systems Rust), Raw Pointers (Macros & Systems Rust)
pthreads to std::threadThreads (Concurrency & Async), Shared State (Concurrency & Async)