Skip to content

Language

This section is the entry point for the Zynx language reference. Use the chapter that matches the behavior you are checking.

Status: current public API unless a chapter explicitly marks behavior as unsupported, unspecified, internal, experimental, or requiring verification.

Core Source Rules

  • Source And Grammar: tokens, declarations, statement forms, expression forms, inline assembly syntax, and formatting policy.
  • Modules And Visibility: modules, imports, package-backed module resolution, bundles, lockfiles, export rules, and privacy.
  • Types And Values: primitive types, text, bytes, numbers, arrays, tuples, nullable values, static Vector/Matrix shapes, globals, and the var/let/const binding rules. Detailed aggregate guides: Vector Types and Matrix Types.
  • String Interpolation And Formatting: explicit owning ^"..." interpolation, {expr} and {expr:spec} holes, allocation errors, default rendering, and format specifiers.

Control Flow And Semantics

  • Control Flow: statements, semicolons, match, cleanup, defer, with, traps, and async cancellation cleanup.
  • Errors: error sets, throws, try, catch, throw, and error unions.
  • Operators And Evaluation: evaluation order, precedence, built-in operators, and enum literals.

Abstraction And Ownership

  • Generics And Interfaces: generic scope, interface constraints, dynamic interfaces, overload resolution, and operator method rejection.
  • Ownership And Drop: Copy, Unique<T>, Handle<T>, Capsule<T>, move behavior, and drop behavior.
  • Memory, Unsafe, And FFI: references, lifetimes, raw pointers, unsafe code, volatile operations, thread-send safety, layout attributes, and C ABI interop.

Async

  • Async Semantics: cold futures, await, scheduler behavior, structured async APIs, task groups, and reference-capture restrictions.

The language chapters are the source of truth for source behavior. Feature guides and examples are explanatory; when they disagree with a language chapter, the language chapter wins.

Diagnostics Reference

  • Diagnostics Reference: every stable diagnostic code (ZP/ZA/ZB/ZC) referenced by these chapters, with a one-line meaning for each; use zynx --explain <CODE> for the full explanation.

Released under the MIT License.