Zax programming language
Zax is a general-purpose programming language intended to provide high-level capabilities without hiding the lower-level behavior, costs, and tradeoffs producing them.
Project status: Zax is in conceptual design. The current conceptual-design pages below own the accepted concerns assigned to them. The root topic pages remain legacy design notes being reviewed; none of this material is a formal specification or implementation promise.
Start here
- Read the Zax language vision for its purpose, audience, foundational direction, goals, advantages, non-goals, and accepted tradeoffs.
- Read Zax language principles for the reusable principles that guide source, APIs, and future language decisions.
- Read Zax source structure for statement-level newlines, continuation, bodies, semicolon composition, mandatory layout, and comments.
- Read Zax declarations and bindings for declaration, initialization, binding visibility, qualifiers, and assignment boundaries.
- Read Zax type definitions for named and
anonymous identity, stored members, type-body organization, self-reference,
completion, lifecycle handoffs, and
outer trackedintegration. - Read Zax unions for untagged offset-zero lenses, passive/all-bit-safe overlays, jagged storage, and explicit unsafe lens responsibility.
- Read Zax variants for absent or named-present managed
payloads, contained reconstruction with
.=and reset, checked access, transfer, and alternative selection. - Read Zax optional values for absent or present single-payload wrappers, proven postfix access, contained reconstruction, reset, nested layers, and wrapper-versus-payload qualification.
- Read Zax namespaces and modules for module-local roots, namespace declaration and lookup, generative imports, injection, collisions, and the visibility/export baseline.
- Read Zax composition for named containment, data
publication through
own, expected-type projection throughpreferred, behavior exposure, abstract fulfillment, and outer casting. - Read Zax partials for adding operators, functions,
and state to types you did not write, visibility grants,
sealcategories, added storage and its lifecycle, and hook points. - Read Zax identity types for transparent aliases, distinct identities, admission, projection, exposed and opaque surfaces, and declared identity bridges.
- Read Zax structural shapes and compatibility for identity-versus-shape, compatibility postures, anchored recasting, same-storage views, decomposition, recomposition, and transformation.
- Read Zax conversions and casts to choose among
conversion, stance restatement, compatibility, container navigation, and
unchecked reinterpretation, and for programmer-declared
as,unsafe cast, and pointer/integer conversion. - Read Zax qualifiers for place replacement, value mutability, access capabilities, defaults, indirection, and unsafe escape behavior.
- Read Zax transfer stances for why
copy,deep,move, andlastexist; how source and receiver intent select consumers; and how source state changes. - Read Zax lifetimes and references for life paths, instance places, fixed reference binding, replacement, borrowing, escape, and capture.
- Read Zax Nothing instances for pointer vacancy, unavailable function values, receiverless type calls, compiler-provided/trapping/custom Nothing policies, and unchecked access boundaries.
- Read Zax pointers, allocation, and arenas for declaration-bound allocation, raw and managed ownership, allocation policy, control blocks, reset, collection, and arena behavior.
- Read Zax execution context for the per-thread
___context, its application-wide shape, replacement, and context-provided default arenas. - Read Zax safety and analysis for safe guarantees, compiler proof, narrow unsafe responsibility, contract evolution, and lint boundaries.
- Read Zax function invocation for ordinary calls, arguments, defaults, results, result routing, and callable selection.
- Read Zax exceptional result flow for success versus named exceptional outcomes, local handling, explicit forwarding, cleanup, and conditional result elision.
- Read Zax lambdas and callable composition for lambda expressions, captures, callable storage and receiver lifetime, partial application, composition, reshape mapping, chaining, reset, and weak callbacks.
- Read Zax intent acknowledgements for defined but suspicious-looking source that requires explicit confirmation.
- Read Zax construction, replacement, and destruction for constructors, construction packets, generated lifecycle operations, same-storage replacement, and destruction.
- Read Zax arrays and slices for fixed and resizable arrays, array expressions, usable capacity, storage strategies, indexing, slicing, element places, joining, and traversal.
- Read Zax
usingfor parenthesizedusingresource lists, structuraldispose, disposal and destruction order, and explicit disposal bypass. - Read Zax core flow control for exact-
Booleanconditions,if/else, loops, explicitscope, flow labels, andbreak/continue/next/goto/return. - Read Zax switch, case, and default for
ordered
switch/casetesting, case operators, clause posts, direct body entry,default, exhaustiveness, and optional or enum selection. - Read Zax iteration for
each in, cursor-driveneach from, entry bindings, progression, active-traversal access, erasure, mutation responsibilities, and costs. - Read Zax operators for the shared operator mental model, declarations, receiver discovery, selection, expected results, evaluation, protected domains, and fallback.
- Read Zax operator phrases for word-spelled operations, receiver-owned declarations, candidate interpretations, grouping, fencing, physical presentation, and phrase-specific diagnostics.
- Use the Zax operator catalog to look up exact symbolic/circumfix forms, precedence, built-in arithmetic, logical, bitwise, shift, mutation, result, and availability behavior.
- Read Zax integers for exact and target-selected integer types, representation, conversion, arithmetic policy, counts, sizes, and portability.
- Read Zax fixed-point scalars for bounded
coefficient scales,
I<W>F<F>and Q names, arithmetic, full-precision products, conversion, representation, and costs. - Read Zax binary floating-point scalars for exact and profile-selected formats, rounding, special values, support, conversion, representation, Extended80, and MBF40.
- Read Zax integer literals and realization for
how number literals get a type, how pre-unary
+states signedness intent, how typed operands affect them, and when a value does not fit. - Read Zax literal source and literal operators for ordinary real and string source, attached literal phrases, payload merging, compile-time joining, radix catalogs, and custom literal declarations.
- Read Zax strings and characters for byte, ASCII, Unicode, and legacy character/string identities, literal forms, encoding transformations, and compile-time joins.
- Use the Zax integer operator catalog
to look up complete protected integer availability, results, policies,
failures, counts, shifts, conversion,
delta, anddistance. - Read Zax mixfix operators for direct multi-component tree operations, holes, receiver anchors, matching, decomposition, and protected barriers.
- Read Zax endianness for intrinsic little/big scalar specialization, absolute and environment-selected names, numeric conversion, byte-preserving coercion, and native versus compiler-host and target byte order.
- Read Zax compile-time code for computing
values and choosing code while compiling, execution policies, values crossing
into the program,
wellformed{...}checks, and compilation information. - Read Zax compiler directives for what a
[<...>]directive is, where it attaches, directive ranges, deprecation, source mapping, and the directive catalog. - Use Zax language-design terms for cross-cutting descriptive vocabulary used by current conceptual design.
- Use the grouped design notes below when exploring a specific proposed concept.
Current conceptual design
- Language vision
- Language principles
- Source structure
- Declarations and bindings
- Type definitions
- Unions
- Variants
- Namespaces and modules
- Composition
- Partials
- Identity types
- Structural shapes and compatibility
- Conversions and casts
- Enums
- Qualifiers
- Transfer stances
- Lifetimes and references
- Nothing instances
- Pointers, allocation, and arenas
- Execution context
- Safety and analysis
- Function invocation
- Exceptional result flow
- Lambdas and callable composition
- Intent acknowledgements
- Optional values
- Construction, replacement, and destruction
- Arrays and slices
using- Core flow control
- Switch, case, and default
- Iteration
- Operators
- Operator phrases
- Operator catalog
- Integers
- Fixed-point scalars
- Binary floating-point scalars
- Integer literals and realization
- Literal source and literal operators
- Strings and characters
- Integer operator catalog
- Mixfix operators
- Endianness
- Compile-time code
- Compiler directives
- Language-design terms
Legacy language-design notes
These pages preserve substantial prior design work. Their detailed syntax and semantics remain non-authoritative until individually reviewed and promoted.
Foundations and flow
- Basics — legacy foundations; current scalar and literal design is owned by Zax integers, literal source and operators, and strings and characters
- Variadic functions
- Flow control — legacy value-polymorphism input; current ordinary flow and runtime selection are owned by core flow control and switch, case, and default
Types and data modeling
- Optional values — current optional wrapper, construction, transfer, qualification, and proven-access design
- Partials — current partial, visibility-grant, sealing, added-storage, and hook design
Memory and lifetime
- Lifetimes and references — current life-path and non-owning reference design
- Pointers, allocation, and arenas — current dynamic allocation, ownership, disposition, and arena design
Build-time programming and modules
- Compiler directives — deferred legacy input for
source generation, generic selection, source inclusion, async, ABI,
panic-function, and
once-value directives; current directives are owned by compiler directives and compile-time code - Meta-functions
- Meta-types
- Namespaces and modules — current namespace, import, injection, visibility-baseline, alias, and forwarding integration