Targets · TypeScript · 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 TypeScript it renders to. It is the same program shown on the language page .
How a Program becomes TypeScript, 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 same output as JavaScript , with Program's types written out. The module is a namespace ; the record is a class with typed fields; the union is a discriminated type with constructors; the function carries its input, hole and return types, and reactive values are ReactiveValue<T> .
Indentation becomes nested closures, as in every target; the difference here is purely the annotations Program's types add. Dotted names pass straight through as nested namespaces — see naming considerations . The per-keyword mapping is on keywords .