Native Performance
Rux compiles to lean, self-contained native binaries — no virtual machines, no interpreters, no garbage collector pauses. Ship code that runs as fast as the hardware allows.
Fast, compiled, strongly typed, multi-paradigm, general-purpose
Rux compiles to lean, self-contained native binaries — no virtual machines, no interpreters, no garbage collector pauses. Ship code that runs as fast as the hardware allows.
No implicit conversions and surprises. Primitive data types from 8 to 512 bits, multi-width Unicode characters, slices, tuples, structs, enums, and unions — all resolved at compile time, zero runtime cost.
References (&T) and pointers (*T) are first-class and distinct. Get the safety of high-level code and the power of low-level control — without the discipline tax or the complexity.
Write imperative code, compose with higher-order functions, or model with structs and interfaces — whatever fits the problem. All paradigms, zero runtime overhead, no forced style.
Inline assembly, raw pointer arithmetic, union-based memory reinterpretation, direct foreign function interface. When you need the metal, Rux gets out of the way.
Reads like pseudocode and compiles like assembly. No ceremony, no hidden conversions, no boilerplate. Code that looks right usually is right.
The entire toolchain — compiler, package manager, formatter, and test runner — ships as a small single binary with zero dependencies. One download, everything included.
From command line tools to game engines and servers — Rux handles it all. Target Windows, Linux, macOS, and more from the same clean source code.
import Std::Io::PrintLine;
// Entry point of the program
func Main() -> int {
let greetings = [
"Hello World",
"你好,世界",
"नमस्ते दुनिया",
"Hola Mundo",
"Bonjour le monde",
"مرحبا يا عالم",
"হ্যালো বিশ্ব",
"Привет мир",
"Olá Mundo",
"سلام دنیا",
"Привіт світ",
"🐯🐶🐱🐭"
];
for greeting in greetings {
PrintLine(greeting);
}
return 0;
}import Std::Io::Print;
/// Computes the factorial of a number using an iterative approach
func Factorial(n: uint) -> uint {
let result: uint = 1;
for i in 2..=n {
result *= i;
}
return result;
}
/// Entry point of the program
func Main() -> int {
let number = 10;
let fact = Factorial(number);
Print("Factorial of {} is {}\n", number, fact);
return 0;
}import Std::Io::Print;
// Regular function
func Add(x: int32, y: int32) -> int32 {
return x + y;
}
// Function with conditional logic
func Max(a: int32, b: int32) -> int32 {
if a > b {
return a;
} else {
return b;
}
}
// Generic function
func Div<T>(x: T, y: T) -> T {
return x / y;
}
func Main() -> int {
let sum = Add(5, 10);
let quotient = Div(10.0, 2.0);
let max = Max(5, 10);
Print("Sum: {}, Quotient: {}, Max: {}", sum, quotient, max);
return 0;
}// Signed integer types
let value: int8; // 1 byte
let value: int16; // 2 bytes
let value: int32; // 4 bytes
let value: int64; // 8 bytes
let value: int128; // 16 bytes
let value: int256; // 32 bytes
let value: int512; // 64 bytes
// Unsigned integer types
let value: uint8; // 1 byte
let value: uint16; // 2 bytes
let value: uint32; // 4 bytes
let value: uint64; // 8 bytes
let value: uint128; // 16 bytes
let value: uint256; // 32 bytes
let value: uint512; // 64 bytes
// Platform-dependent integer types
let value: int; // 4 or 8 bytes
let value: uint; // 4 or 8 bytes
// Integer literals
let value = 42; // decimal
let value = 0x2A; // hexadecimal
let value = 0o52; // octal
let value = 0b101010; // binary
let value = 32i8; // int8
let value = 1000u64; // uint64// Floating-point types
let value: float8; // 1 byte
let value: float16; // 2 bytes
let value: float32; // 4 bytes
let value: float64; // 8 bytes
let value: float80; // 10 bytes
let value: float128; // 16 bytes
let value: float256; // 32 bytes
let value: float512; // 64 bytes
// Universal floating-point type
let value: float; // 8 bytes
// Literal floating-point values
let value = 3.141592; // float
let value = 1.2e-6; // float
let value = 3.14f8; // float8
let value = 3.14f16; // float16
let value = 3.14f32; // float32
let value = 3.14f80; // float80
let value = 3.14f128; // float128
let value = 3.14f256; // float256
let value = 3.14f512; // float512// Boolean types
let value: bool8; // 1 byte
let value: bool16; // 2 bytes
let value: bool32; // 4 bytes
let value: bool64; // 8 bytes
let value: bool128; // 16 bytes
let value: bool256; // 32 bytes
let value: bool512; // 64 bytes
// Universal boolean type
let value: bool; // 1 byte
// Boolean literals
let value = true; // bool
let value = false; // bool// Character types
let value: char8; // 1 byte
let value: char16; // 2 bytes
let value: char32; // 4 bytes
let value: char64; // 8 bytes
let value: char128; // 16 bytes
let value: char256; // 32 bytes
let value: char512; // 64 bytes
// Universal character type
let value: char; // 4 bytes
// Character literals
let value = 'A'; // char
let value = '😊'; // char
let value = '\n'; // newline
let value = '\t'; // tab// Example of pointer usage
var ptr: *int32 = null;
// Pointer to a constant value
var ptr: *const int32 = null;
// Floating-point value
var value: float64 = 3.1415;
// Constant pointer to a value
const ptr: *float = &value;
// Constant pointer to a constant value
const ptr: *const int32;
// Pointer to a pointer 🤯
var data: **int64 = null;// Variable
var value: int = 10;
// Allowed, as 'var' is mutable
value = 15;
// Immutable variable
let value: int = 20;
// Not allowed, as 'let' is immutable
// This will cause a compile-time error
value = 25;
// Compile-time constant
const value: int = 30;
// Not allowed and will cause a compile-time error
value = 35;// Import package
import Math;
// Import a package with an alias
import Math as Calc;
// Import all items from a package
import Math::*;
// Import specific items from a package
import Math::Sin;
// Import multiple specific items from a package
import Math::{ Sin, Cos };
// Import specific item from a package with an alias
import Math::Cos as Cosine;Subscribe on X, Bluesky, Mastodon, or Telegram to get early updates, dev logs, and sneak peeks. Join the conversation on Discord, GitHub Discussions, or Reddit. We’d love to hear from you! Not sure where to ask your question or how to get involved? Our community team is here to give you the right answer and help you get started at [email protected].