Targets · Go · Naming considerations
Naming considerations
A Program name nests to any depth — Ui.Button.Integer.Increment. This page is how
that dotted name is carried into Go, which has no matching nesting.
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.
- Introduction — what the Go target is, and how to read the rest of this section.
- Capabilities — which high-level features are possible, built in or through a library.
- Example — a full program using every keyword, and the Go it renders to.
- Naming considerations — how Program's dotted names are carried into Go.
- Entry point — starting a program from
mainwith its drivers. - Drivers — the native drivers that provide the interface, console and network.
- Runtime — the Reactive and Context machinery the rendered code links against.
- Native modules — the hand-written Go behind
NATIVEfunctions. - Keywords — how each of Program's keywords renders to Go.
- Project setup — the files and commands to build and run the rendered program.
- Reserved words — the words Go keeps for itself, and how a colliding name is escaped.
How it looks
Go keeps the last segment as a member and joins everything before it with an underscore.
Ui_Button_Integer.Increment(count, func() { … }) // was Ui.Button.Integer.Increment
The natural idiom
Go groups code by package, and a package cannot nest into another with a dot path. Within a
package, exported functions are flat (maths.Add), and export is decided by
capitalisation, not a keyword. There is no way to write four real dots for
Ui.Button.Integer.Increment.
Can the real dotting be faked?
Only the final dot is real. Each top module becomes one lowercase Go package; the segments below it are joined with an underscore into a zero-field “static” struct, and the leaf is a method on it — giving one genuine dot at the call.
package ui
type Ui_Button_IntegerStatic struct{}
var Ui_Button_Integer = Ui_Button_IntegerStatic{}
func (Ui_Button_IntegerStatic) Increment(count ReactiveValue[int64], body func()) { … }
// the call keeps one real dot:
Ui_Button_Integer.Increment(count, func() { … })
Because _ is illegal in a Program identifier the join can never collide with a written
name, and Go's PascalCase leaves the names already exported. A record TYPE
type becomes a struct named the same way, or a native type for a built-in
(Maths.Integer → int64).
Recommendation
Use the underscore join with one package per top module. Only the last access is a real dot, but it is unambiguous and reads closely to the source — the same compromise Dart makes, and unlike Rust, Swift and Zig, which keep every dot.