ROX Language
ROX is a minimal, clarity-first programming language built on a simple belief:
Programming logic should not have to fight the language.
ROX removes implicit behavior, hidden conversions, and syntactic tricks so that expressing logic feels direct and mechanical rather than negotiated.
Why ROX Exists
In many languages, expressing simple logic often requires navigating implicit type coercions, silent conversions, operator overloading, hidden control flow, and exception systems.
ROX intentionally removes these. The goal is clarity of expression.
- Every type is explicit.
- Every error is a value.
- Every access is deliberate.
- Nothing implicit happens behind your back.
Core Principles (v0)
- No implicit type conversions
- No bracket indexing (
[]only for list literals) - No exceptions — errors are explicit values (
rox_result[T]) - A single loop construct (
repeat) - Explicit control flow only
- Strict compile-time type checking
Example: Two Sum
function two_sum(list[num] nums, num target) -> list[num] {
num n = nums.size();
repeat i in range(0, n, 1) {
repeat j in range(i + 1, n, 1) {
rox_result[num] r1 = nums.at(i);
if (not isOk(r1)) { return [-1, -1]; }
num v1 = getValue(r1);
rox_result[num] r2 = nums.at(j);
if (not isOk(r2)) { return [-1, -1]; }
num v2 = getValue(r2);
if (v1 + v2 == target) {
return [i, j];
}
}
}
return [-1, -1];
}
Notable Properties
.at()returnsrox_result[T]- Errors must be handled explicitly
- No implicit casts
rangeis the only loop construct
Language Features (v0)
Types
num(int64)num32(int32)boolcharnonelist[T]dictionary[K, V]rox_result[T]
Control Flow
if/elserepeat i in range(start, end, step)
Built-in Functions
print(list[char]) -> nonelistToString(list[T]) -> list[char]isOk(rox_result[T]) -> boolgetValue(rox_result[T]) -> T
Math Library
num32
num32_abs(n)num32_min(a, b)num32_max(a, b)num32_pow(base, exp) -> rox_result[num32]
num
num_abs(n)num_min(a, b)num_max(a, b)num_pow(base, exp) -> rox_result[num]
float
float_abs(n)float_min(a, b)float_max(a, b)float_pow(base, exp)float_sqrt(n) -> rox_result[float]float_sin(n)float_cos(n)float_tan(n)float_log(n) -> rox_result[float]float_exp(n)float_floor(n)float_ceil(n)
Constants
pi(float)e(float)
Error Model
ROX does not use exceptions. Errors are explicit values:
rox_result[num] r = nums.at(i);
if (not isOk(r)) {
return [-1, -1];
}
num value = getValue(r);
Nothing throws. Nothing hides.
Download & Build
You can verify and run algorithms locally using the Playground or by building the compiler from source.