Targets · Swift · 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 Swift it renders to. It is the same program shown on the language page .
How a Program becomes Swift, 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 module becomes a caseless enum ; the record a struct and the union an enum with cases, both keeping the dotted path; the function's swift body is spliced in; and the trailing = becomes a return .
Indentation becomes nested trailing closures — the REVERSE body is a { … } . Dotted names stay real through nested enums ( Network.Web.Client.Post ) — see naming considerations . The per-keyword mapping is on keywords .