Skip to content

Quxlang Reference

The Reference specifies the implemented Quxlang language and toolchain. Its scope includes accepted syntax, semantic constraints, failure behavior, target availability, and interactions between features. The Reference Conventions define the terminology and scope used throughout these pages.

Language syntax

Topic Contents
Lexical Structure Tokens, comments, identifiers, keywords, and source text
Source Files and Imports File preamble, modules, IMPORT, aliases, and conditional imports
Namespaces Namespace declarations, qualification, aliases, and lookup
Declaration Documentation DOC attachment and declaration coverage
Privacy Module visibility and exported aliases
Target Availability INCLUDE_IF, target predicates, and runtime CPU queries

Declarations, values, and types

Topic Contents
Variables VAR, initialization forms, scope, storage duration, and AUTO
Thread-Local Variables VAR PER_THREAD, initialization, teardown, and target support
STATIC Constants Compile-time constant declarations and evaluation
Primitive Types and Literals Built-in scalar types and literal categories
Arrays Fixed-size arrays, initialization, indexing, and element access
Composites Named and positional fields, transforms, reflection, and argument expansion
References Access qualifiers, binding, conversion, and lifetime requirements
Pointers Pointer classes, operations, conversions, and validity
Optional and Owning Values OPTIONAL, GENERIC, GENERIC_REF, and ownership contracts
Type Queries and Deduction AUTO, DECLTYPE, type properties, and dynamic type identity
Conversions Implicit and explicit conversion modes and their failure contracts

Functions and generic programming

Topic Contents
Functions Function declarations, parameters, receivers, and return types
RETURN Statements Value returns, reference returns, conditional returns, and ordering returns
Call Arguments Named and positional groups, evaluation, forwarding, and construction
Default Arguments Declaration context, omission, and overload participation
Overload Resolution Candidate construction, viability, ranking, and ambiguity
Procedure Pointers and Function Values Callable types, binding, indirect calls, and conversions
Templates Type and value parameters, deduction, and instantiation
Variadic Packs Pack declarations, expansion, indexing, and forwarding
Lambdas Capture, callable interface, lifetime, and conversion
Interfaces and Implementations Interface requirements, implementation selection, and handles
Generics Type erasure, ownership, constraints, and dispatch

Expressions and statements

Topic Contents
Operator Precedence Expression grouping and associativity
Assignment Operators Assignment contracts and compound forms
Increment and Decrement Prefix and postfix forms and supported operands
Swap Operator Built-in and user-defined swap behavior
Move Semantics Temporary references, relocation, and moved-from values
Arithmetic Operators Numeric operations, checked forms, assumed forms, and overflow
Comparison Operators Equality, three-way comparison, derived relations, and dispatch
Floating-Point Ordering Total ordering and IEEE predicate operations
Logical Operators Boolean operations, short-circuiting, and conditional forms
Bitwise Operators Integer bit operations, shifts, and rotations
User-Defined Operators Operator declarations, reflected forms, and selection
Conditional Statements IF, ELSE, branch conditions, and scope
LOOP WHILE Loops Pre-test and post-test conditional iteration
LOOP Statements Range, iterator, collection, and unconditional loop forms
Labels and GOTO Labels, jumps, scope exits, and restrictions
Exception Handling Throwing, matching, cleanup, rethrow, handles, and NOEXCEPT
Failure Statements Assertions, panic, compilation errors, and unimplemented paths
Compilation Policies Per-output assertion, bounds, overflow, and unimplemented behavior

Structures, lifetime, and alternatives

Topic Contents
Structures Members, receivers, nested declarations, and generated operations
Public Field Reflection Public-field enumeration and access queries
Inheritance Base subobjects, polymorphism, casts, construction, and destruction
Constructors and Destructors Object initialization, teardown, and generated functions
Object Storage and Lifetime Raw storage, PLACE, DESTROY, and active objects
Compile-Time Allocation Allocation regions and constant-evaluation storage
NEW and DELETE Typed allocation, construction, destruction, and deallocation
Enums Nominal enumerations, values, conversions, and generated operations
Flagsets Bit flag declarations, widths, operations, and conversion
Unions Untagged alternatives, active members, lifetime, and generated operations
Variants Tagged alternatives, construction, access, and state
VISIT Variant visitation, callable requirements, and return types
MATCH Pattern arms, binding, coverage, and control flow

Evaluation, interoperation, and execution

Topic Contents
Compile-Time Evaluation Constant execution, state, restrictions, and diagnostics
Runtime Selection RUNTIME CONSTEXPR and RUNTIME NATIVE selection
Serialization Generated and custom serialization contracts
Stringlike Types Character sequences and stringlike interfaces
Variable-Length Integer Serialization Integer encodings and size behavior
External Types External layout declarations and representation constraints
External Memory IBC access and runtime address operations
External Procedures Native symbols, libraries, calling conventions, and target formats
Assembly Procedures Architecture-specific callable bodies and symbolic operands
Atomics Atomic operations, ordering, waiting, and notification
Tests Static, unit, and dual tests and their execution modes

Toolchain and output

Topic Contents
Toolchain Compiler and build-tool roles
qxcbuild.yml Bundle, target, output, and library configuration
Build Options Build options available to source code
CPU Capabilities and Steppings Capability names, detection, and multiversion selection
Program Startup and Runtime Hooks Entry procedures, stepping arrays, and startup contracts
Runtime Module Contracts Required runtime declarations and target-specific obligations
Backends and Layout Backend boundaries and native versus layoutless targets
Compiler Output Emitted artifacts and output-specific behavior

Forward-looking proposals and internal VMIR formats are outside this Reference.