Language Reference (v0.2.1)

Stable syntax topics with behavior notes and practical guidance.

Latest

The language reference maps syntax materials into topic pages with plain explanations. Each topic includes a short overview, representative signatures, notes about behavior, and practical guidance.

Pages can be read in order or used independently. They prioritize stable constructs and clear behavior over shorthand descriptions.

Types

Primitive and built-in type forms used by Thrust.

Open topic

Variables

Declaration and mutation patterns for local and static storage.

Open topic

Constants

Compile-time values that cannot be reassigned.

Open topic

Functions

Function declarations, arguments, return types, and visibility.

Open topic

Generics

Compile-time generic templates for functions and structures.

Open topic

Modules

Imports, aliases, and selective import scopes.

Open topic

Statements

Conditional and control statements for runtime execution.

Open topic

Compile-Time Conditionals

Target-dependent branching using @if, @elif, and @else.

Open topic

Attributes

Declaration modifiers for linkage, calling convention, and compile-time behavior.

Open topic

Builtins

Compiler-provided functions, low-level memory and ABI operations, and builtin types for type, target, host, and compile-time work.

Open topic

Casts

Explicit type conversion between compatible source and target types.

Open topic

Loops

while, for, and loop constructs for repeated execution.

Open topic

Structs

User-defined aggregate types with named fields.

Open topic

Enums

Named constants grouped under a common enum name.

Open topic

Foreign Function Interface

Calling C functions through @extern and @convention attributes.

Open topic

Deref and Pointers

Pointer access, references, and dereference operations.

Open topic

Back to documentation hub