Compiled for Speed
Rux compiles directly to native machine code — no virtual machine, no interpreter, no hidden runtime. Output binaries are lean and self-contained, running on Windows with no additional frameworks or redistributables required.
Fast, compiled, strongly typed, multi-paradigm, general-purpose
Rux compiles directly to native machine code — no virtual machine, no interpreter, no hidden runtime. Output binaries are lean and self-contained, running on Windows with no additional frameworks or redistributables required.
No implicit conversions, no hidden boxing. Built-in types span integers from 8-bits to 512-bits, multi-width characters (char8, char16, char32), slices, fixed arrays, tuples, structs, enums, and unions — all resolved at compile time.
Memory safety is built-in, not bolted on. Rux distinguishes references (&T) and pointers (*T) clearly, allowing both safe high-level code and low-level control. Unlike C++, you don’t need manual discipline.
Rux blends procedural, functional, and object-oriented paradigms seamlessly. You can write clean imperative code, use higher-order functions, or design modular, data-driven systems — all with zero runtime overhead.
Raw pointer arithmetic, inline assembly, sizeof, unions for memory reinterpretation, and direct FFI and Windows API — Rux gives you full hardware access when you need it. The type system stays in control; you stay in charge.
Rux’s syntax is minimal yet expressive — designed to read like pseudocode and compile like assembly. No clutter, no hidden conversions, no unnecessary ceremony. Readable, concise, and fully type-safe.
Compile at up to 150K LOC under 20 MB of RAM. The entire toolchain — compiler, package manager, formatter, and test runner — ships as a single binary under 3 MB with zero dependencies. One download, everything included.
Rux isn’t just for systems programming. It’s equally comfortable writing CLI tools, servers, games, or libraries. Compile to Windows, Linux, macOS, and more — all 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].