Targets · Rust · Example
The whole language in one short program — a module with a record, a tagged union, a function with per-platform native bodies, and a function that wires up state, a write-back and a return — and the complete Rust it renders to. It is the same program shown on the language page .
How a Program becomes Rust, in parts. Start with the introduction, then follow each part into the rendered output and the runtime it links against.
Each keyword has its own page under keywords ; here they are all together.
(The function's swift row is replaced with a rust one here, since Rust needs its own NATIVE body.)
The module is a mod ; the record is a struct and the union an enum , both keeping their :: path; state uses generics; the function's rust body is spliced in; closures are boxed; and the trailing = is the final expression.
Indentation becomes nested boxed closures — the REVERSE body is a Box::new(move || { … }) . Dotted names stay real through nested modules, with :: for the dots ( network::web::client::Post ) — see naming considerations . The per-keyword mapping is on keywords .