Targets · Go · Keywords

Keywords

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

Contents

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

Program keywords in Go

Each of Program's keywords maps to idiomatic Go. Names join with an underscore into one “static” struct (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 Go
MODULEA lowercase Go package, with names underscore-joined into a static struct — Ui.Button.Integer becomes Ui_Button_Integer.
TYPEA record becomes type Point struct { x float64; y float64 }; a union becomes a struct with a tag and one optional field per option.
FUNCTIONA method on the static struct: func (S) Name(…) T { … }.
NATIVEA method whose body is the go NATIVE string.
INPUTA parameter; a BINDING input is read and written.
HOLEA trailing func() callback parameter.
LETname := ….
STATEname := Reactive.State[T](value).
REVERSEA write-back whose closing SET is Reactive.Set(state, value).
WITHModule_With(Name, Replacement, func() { … }).

See JavaScript keywords for the per-keyword detail and the modifiers; Go differs in idiom (packages, underscore-joined static structs) but the mapping is the same.