Skip to content

The Bynk Language Specification

The normative definition of Bynk: the language as accepted and compiled by bynkc at the current version, v0.109. It states what a conforming implementation must accept, what it must reject, and what a program means. Where the grammar reference is a friendly, per-construct lookup for people writing Bynk, this is the complete, citable definition for implementers and for precise reference. Each language increment updates this document in place (Scope §1.1); the decisions behind increments are recorded in design/decisions/.

The two coexist by register, not by contradiction. They draw on the same generated ingredients — the grammar productions, the static-semantics-to- diagnostics weave, the diagnostic index, the grammar appendix — so the hard facts cannot diverge; only the prose differs (explanatory there, normative here).

Bynk is translation-defined. Its three layers of definition are:

  • Syntax — the grammar, generated from tree-sitter-bynk, so the productions in this spec cannot drift from the parser.
  • Static semantics — well-formedness rules. A program is well-formed exactly when it provokes no bynk.* diagnostic; each rule is tied to its diagnostic code(s), so the rule catalogue and the compiler cannot drift.
  • Dynamic meaning — defined by translation: each construct’s behaviour is the TypeScript it emits, together with the runtime-library contract. There is no separate operational semantics.

Conventions §2 makes this model precise and fixes the notation; Scope §1 fixes what is normative and what conformance means.