Targets · Dart · Keywords

Keywords

How each of Program's keywords is rendered into Dart.

Contents

How a Program becomes Dart, in parts. Start with the introduction, then follow each part into the rendered output and the runtime it links against.

Program keywords in Dart

Each of Program's keywords maps to idiomatic Dart. Names join with an underscore into one final class (see the example); the reactive keywords are calls into the runtime. Follow a keyword's own page for the full rendering and the other targets.

KeywordRendered Dart
MODULEUnderscore-joined into one final classUi.Button.Integer becomes Ui_Button_Integer.
TYPEA record becomes final class Point { final double x; final double y; Point(this.x, this.y); }; a union becomes a sealed class with one final class per option.
FUNCTIONstatic ReactiveValue<T> Name(…) { … return …; }.
NATIVEA static method whose body is the dart NATIVE string.
INPUTA parameter; a BINDING input is read and written.
HOLEA trailing Function callback parameter.
LETfinal name = …;.
STATEfinal name = Reactive.State<T>(value);.
REVERSEA write-back whose closing SET is Reactive.Set(state, value).
WITHModule.With(Name, Replacement, () { … }).

See JavaScript keywords for the per-keyword detail and the modifiers; Dart differs in idiom (underscore-joined classes, final bindings) but the mapping is the same.