Native Performance
Compiles straight to native machine code. No virtual machine, no interpreter, no garbage collector pauses.
Compiles straight to native machine code. No virtual machine, no interpreter, no garbage collector pauses.
Compiler, linter, package manager, formatter, and test runner — one small binary, zero dependencies.
No implicit conversions, no surprises. Everything is checked at compile time and free at runtime.
References are checked and safe, pointers are raw and unchecked. You choose — no hidden cost on either.
Imperative, functional, or data-oriented — pick what fits the problem, no forced style.
Inline assembly, raw pointers, and FFI. When you need the metal, Rux gets out of the way.
Reads like pseudocode, compiles like assembly. No ceremony, no boilerplate.
Build CLI tools, servers, and games for Linux, Windows, and macOS from the same source.
One small download gives you the compiler, linter, package manager, formatter, and test runner. No SDKs to chain together, nothing else to install.
Code that does what it looks like it does — explicit, predictable, and free of ceremony.
import Std::Io::Print;
// Entry point of the program
func Main() -> int {
Print("Hello, Rux!");
return 0;
}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 {
var 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 {
return a > b ? a : 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;
}import Std::Io::Print;
func Sum(values: int...) -> int {
var total = 0;
for v in values {
total += v;
}
return total;
}
func Main() -> int {
Print("Sum of 1, 2, 3 is {}\n", Sum(1, 2, 3)); // 6
Print("Sum of 10, 20 is {}\n", Sum(10, 20)); // 30
Print("Sum with no arguments is {}\n", Sum()); // 0
return 0;
}import Std::Math::Sqrt;
struct Vector {
x: float64;
y: float64;
z: float64;
}
extend Vector {
func New(x: float64, y: float64, z: float64) -> Vector {
return Vector { x: x, y: y, z: z };
}
func Length(self) -> float64 {
return Sqrt(self.x * self.x + self.y * self.y + self.z * self.z);
}
func *(self, other: Vector) -> float64 {
return self.x * other.x + self.y * other.y + self.z * other.z;
}
func +(self, other: Vector) -> Vector {
return Vector { x: self.x + other.x, y: self.y + other.y, z: self.z + other.z };
}
}// 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;Syntax highlighting and language support, wherever you write code.
Rux is free, open source, and developed independently. You could be the first.