Rux Programming Language
Skip to content
Appearance
RuxProgramming Language<br>Fast, compiled, strongly typed, multi-paradigm, general-purpose<br>Get Started<br>Reference
Native Performance<br>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.
Bulletproof Type System<br>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.
Memory Safety<br>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.
Multi-Paradigm Design<br>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.
Full Hardware Access<br>Inline assembly, raw pointer arithmetic, union-based memory reinterpretation, direct foreign function interface. When you need the metal, Rux gets out of the way.
Clean Syntax<br>Reads like pseudocode and compiles like assembly. No ceremony, no hidden conversions, no boilerplate. Code that looks right usually is right.
Instant Toolchain<br>The entire toolchain — compiler, package manager, formatter, and test runner — ships as a small single binary with zero dependencies. One download, everything included.
Cross-Platform<br>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.
Code Examples <br>Hello.ruxFactorial.ruxFunc.ruxInt.ruxFloat.ruxBool.ruxChar.ruxPointer.ruxMut.ruxImport.rux<br>ruximport Std::Io::PrintLine;
// Entry point of the program<br>func Main() -> int {<br>let greetings = [<br>"Hello World",<br>"你好,世界",<br>"नमस्ते दुनिया",<br>"Hola Mundo",<br>"Bonjour le monde",<br>"مرحبا يا عالم",<br>"হ্যালো বিশ্ব",<br>"Привет мир",<br>"Olá Mundo",<br>"سلام دنیا",<br>"Привіт світ",<br>"🐯🐶🐱🐭"<br>];<br>for greeting in greetings {<br>PrintLine(greeting);<br>return 0;<br>ruximport Std::Io::Print;
/// Computes the factorial of a number using an iterative approach<br>func Factorial(n: uint) -> uint {<br>var result: uint = 1;<br>for i in 2..=n {<br>result *= i as uint;<br>return result;
/// Entry point of the program<br>func Main() -> int {<br>let number = 10;<br>let fact = Factorial(number);<br>Print("Factorial of {} is {}\n", number, fact);<br>return 0;<br>ruximport Std::Io::Print;
// Regular function<br>func Add(x: int32, y: int32) -> int32 {<br>return x + y;
// Function with conditional logic<br>func Max(a: int32, b: int32) -> int32 {<br>if a > b {<br>return a;<br>} else {<br>return b;
// Generic function<br>func DivT>(x: T, y: T) -> T {<br>return x / y;
func Main() -> int {<br>let sum = Add(5, 10);<br>let quotient = Div(10.0, 2.0);<br>let max = Max(5, 10);<br>Print("Sum: {}, Quotient: {}, Max: {}", sum, quotient, max);<br>return 0;<br>rux// Signed integer types<br>let value: int8; // 1 byte<br>let value: int16; // 2 bytes<br>let value: int32; // 4 bytes<br>let value: int64; // 8 bytes<br>let value: int128; // 16 bytes<br>let value: int256; // 32 bytes<br>let value: int512; // 64 bytes
// Unsigned integer types<br>let value: uint8; // 1 byte<br>let value: uint16; // 2 bytes<br>let value: uint32; // 4 bytes<br>let value: uint64; // 8 bytes<br>let value: uint128; // 16 bytes<br>let value: uint256; // 32 bytes<br>let value: uint512; // 64 bytes
// Platform-dependent integer types<br>let value: int; // 4 or 8 bytes<br>let value: uint; // 4 or 8 bytes
// Integer literals<br>let value = 42; // decimal<br>let value = 0x2A; // hexadecimal<br>let value = 0o52; // octal<br>let value = 0b101010; // binary<br>let value = 32i8; // int8<br>let value = 1000u64; // uint64<br>rux// Floating-point types<br>let value: float8; // 1 byte<br>let value: float16; // 2 bytes<br>let value: float32; // 4 bytes<br>let value: float64; // 8 bytes<br>let value: float80; // 10 bytes<br>let value: float128; // 16 bytes<br>let value: float256; // 32 bytes<br>let value: float512; // 64 bytes
// Universal floating-point type<br>let value: float; // 8 bytes
// Literal floating-point values<br>let value = 3.141592; // float<br>let value = 1.2e-6; // float<br>let value = 3.14f8; // float8<br>let value = 3.14f16; // float16<br>let value = 3.14f32; // float32<br>let value = 3.14f80; // float80<br>let value = 3.14f128; // float128<br>let value = 3.14f256; // float256<br>let value = 3.14f512; // float512<br>rux// Boolean types<br>let value: bool8; // 1 byte<br>let value: bool16; // 2 bytes<br>let value: bool32; // 4 bytes<br>let value: bool64; // 8 bytes<br>let value: bool128; // 16 bytes<br>let value: bool256; // 32 bytes<br>let value: bool512; // 64 bytes
// Universal boolean type<br>let value: bool; // 1 byte
// Boolean literals<br>let value = true; // bool<br>let value = false; // bool<br>rux// Character types<br>let value: char8; // 1 byte<br>let value: char16; // 2 bytes<br>let value: char32; // 4 bytes<br>let value: char64; // 8 bytes<br>let value: char128; // 16 bytes<br>let value: char256; // 32 bytes<br>let value: char512; // 64 bytes
// Universal character...