Macros, Unsafe, FFI & Money
The four edges a systems reviewer is expected to hold: what a derive expands to, what an unsafe block promises, what crossing into C++ costs, and why a float must never hold a balance.
// lessons
- 01
Modules, Visibility & Crate Layout
Use mod, pub and pub(crate) to make an invariant unbreakable from outside.
- 02
macro_rules! & Declarative Macros
Write a macro that a function could not have replaced.
- 03
Derive & Procedural Macros
Say what #[derive(Debug, Clone)] actually generates, and where Serde fits.
- 04
unsafe: The Contract
State the invariant an unsafe block assumes — the skill a reviewer is paid for.
- 05
Raw Pointers & Aliasing
Handle *const/*mut T and name the guarantee you just gave up.
- 06
FFI, extern "C" & the ABI Boundary
Pass ownership across a C boundary without leaking or double-freeing it.
- 07
Integer Money & Checked Arithmetic
Handle a balance in fixed-point integers, and pick between checked, saturating and wrapping deliberately.
Every exercise compiles and runs in the Forge sandbox — standard library only, no external crates.
