Targets · JavaScript · 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 JavaScript.
Contents
How a Program becomes JavaScript, in parts. Start with the introduction, then follow each part into the rendered output and the runtime it links against.
- Introduction — what the JavaScript target is, and how to read the rest of this section.
- Capabilities — which high-level features are possible, built in or through a library.
- Coding standards — the Frenzi coding standards the generated code follows, global and JavaScript-specific.
- Example — a full program using every keyword, and the JavaScript it renders to.
- Naming considerations — how Program's dotted names are carried into JavaScript.
- Entry point — the generated
main()that wires up the drivers and starts the reactive cycle. - Drivers — the native drivers that provide capabilities like the user interface and animation, draining each cycle's emissions.
- Runtime — the Reactive and Context machinery the rendered code links against.
- Native modules — the hand-written, per-platform JavaScript behind
NATIVEfunctions. - Keywords — how each of Program's keywords renders to JavaScript.
- Project setup — the files and commands to build and run the rendered program.
- Reserved words — the words JavaScript keeps for itself, and how a Program name that collides with one is escaped.
How it looks
JavaScript is the easy case: the dotted name is kept exactly as written. There is nothing to munge.
Ui.Button.Integer.Increment(count, () => { … }); // verbatim
The natural idiom
Left to itself, idiomatic JavaScript would reach for ES modules and named imports
(import { increment } from './ui/button/integer.js'), which throws the dotted name
away, or a flat bag of functions. Neither preserves the shape a Program author sees.
Keeping the real dotted name
We do not need to fake it: JavaScript member access is dotted property access. The renderer
emits each namespace segment as a nested plain object and hangs the leaf on it, so
Ui.Button.Integer.Increment is a genuine property path resolved by the engine —
not a string trick.
var Ui = {};
Ui.Button = {};
Ui.Button.Integer = {};
Ui.Button.Integer.Increment = function (count, body) { … };
// every call site is then the Program name, unchanged:
Ui.Button.Integer.Increment(count, () => { … });
The objects are created once, up front, in dependency order. A record TYPE
type is the leaf itself — a class (Geometry.Point) or, for a built-in value type,
a native primitive (Maths.Integer → number).
Recommendation
Use the nested-object namespace directly — there is no compromise to make. Program's names survive into JavaScript with no renaming, no flattening, and no wrapper; the only identifiers ever rewritten are ordinary variables that collide with a reserved word. This is the target the others are measured against.