Language Reference

Language Reference

A compact index of the constructs recognized by the current Raz Gen2 implementation.

Raz Gen2 Manual·Language Reference
Scope: this reference is an inventory of observable implementation behavior. The normative grammar and several type and memory rules still require explicit approval.

Core syntax

Construct Example Purpose
Function function add(a: i64, b: i64) -> i64 { ... } Named function with parameter and return types.
Structure struct Point { x: i64; y: i64; } User-defined record with named fields.
Binding let count: i64 = 0; Mutable local or file-level binding. Type may be inferred.
Immutable binding const limit: i64 = 10; Binding reassignment is rejected. Nested and aliased mutation rules remain open.
Conditional if (ready) { ... } else { ... } Conditional execution. Parentheses are currently optional in parser handling.
Loop while (ready) { ... } Conditional iteration.
Return return result; Returns from a function or top-level execution.
Source inclusion include "math.raz"; Compile-time source expansion.
Module / native import use std.io; Imports a Raz module; a quoted path selects a native header.
Macro define twice(x) { x + x } Token-aware source macro expansion.

Related topics

Open language decisions

  • Make semicolon and optional-parenthesis rules consistent and normative.
  • Define conversions, integer overflow, pointer safety, reference lifetime, and function-value semantics.
  • Resolve the inconsistent extern handling before documenting it as supported syntax.