Rux Language Reference
- Introduction
- Lexical Structure
- 2.1. Source Files
- 2.2. Comments
- 2.3. Keywords
- 2.4. Identifiers
- 2.5. Literals
- 2.6. Operators
- Signed Integers
- Unsigned Integers
- Floating-Point
- Booleans
- Characters
- Variables
- 8.1. Overview
- 8.2. Immutable
- 8.3. Mutable
- 8.4. Mutability of Structs
- Constants
- 9.1. Overview
- 9.2. Intrinsic Constants
- Operations
- 10.1. Overview
- 10.2. Arithmetic Operations
- 10.3. Comparison Operations
- 10.4. Logical Operations
- 10.5. Bitwise Operations
- 10.6. Shift Operations
- 10.7. Type Casts
- 10.8. Type Tests
- Statements
- Functions
- 12.1. Overview
- 12.2. Declaration
- 12.3. Variadic Functions
- 12.4. Generic Functions
- 12.5. Assembler Functions
- 12.6. Main Entry Point
- Structures
- Unions
- 14.1 Overview
- Enumerations
- 15.1. Overview
- 15.2. Backing Type and Values
- 15.3. Variants with Data
- Tuples
- 16.1. Overview
- 16.2. Destructuring
- 16.3. Tuples vs. Structs
- Arrays
- 17.1. Overview
- 17.2. Indexing and Iteration
- 17.3. Arrays as Slices
- Slices
- 18.1. Overview
- 18.2. String Literals
- 18.3. Indexing and Iteration
- 18.4. Slices and Pointers
- Ranges
- 19.1. Overview
- 19.2. Using Ranges
- Pointers
- 20.1. Overview
- 20.2. Pointer Types
- 20.3. The
nullPointer - 20.4. Fields and Members
- 20.5. Pointer Arithmetic
- 20.6. Pointers and
extern
- Type Aliases
- 21.1. Overview
- 21.2. Usage
- 21.3. Function Type Aliases
- 21.4. Built-in Aliases
- Interfaces
- 22.1. Overview
- 22.2. Interface Declaration
- 22.3. Interface Implementation
- Modules
- 23.1. Overview
- 23.2. Module Declaration
- 23.3. Items Visibility
- 23.4. Import
- Error Handling
- 24.1. Overview
- 24.2. The
ResultType - 24.3. Fatal Errors
- Foreign Function Interface
- 25.1. Overview
- 25.2.
externDeclarations - 25.3. Linking Libraries
- Compile-Time Programming
- 26.1. Overview
- 26.2. Conditional Compilation
- 26.3. Build Context
- 26.4. Intrinsics
- Attributes
- Appendix
- 28.1. Primitive Type Reference
- 28.2. Token Reference
- 28.3. Rux Compiled Unit
Packages, manifests, dependencies, and publishing have their own section: Packaging.
Examples
The fastest way to learn Rux is to write a little of it. This page walks you through your first program, then points you to a growing collection of worked examples you can clone and run.
Introduction
Rux is a fast, compiled, strongly typed, and multi-paradigm programming language designed for clarity, safety, and performance. It combines expressive high-level constructs with predictable low-level control, so the same language scales from command-line tools and libraries to applications and services.