> A sovereign systems programming language whose entire compiler is written in 100% pure x86-64 assembly. > Zero libc. Zero C.
The project's README from github.com/tek-sys-hub/Rubix-lang. As one markdown file: README.md.
.ix)
The Ultra-Lightweight x86-64 Systems Programming Language
Zero C. Zero libc. Zero LLVM. A ~42 KB compiler building standalone native binaries in sub-milliseconds.
โโโโโโโ โโโ โโโโโโโโโโ โโโโโโ โโโ
โโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโ
โโโโโโโโโโโ โโโโโโโโโโโโโโ โโโโโโ
โโโโโโโโโโโ โโโโโโโโโโโโโโ โโโโโโ
โโโ โโโโโโโโโโโโโโโโโโโโโโโโโโโ โโโ
โโโ โโโ โโโโโโโ โโโโโโโ โโโโโโ โโโ
A sovereign systems programming language whose entire compiler is written in 100% pure x86-64 assembly.
Zero libc. Zero C. Zero LLVM. Zero Virtual Machines. Zero bloated toolchains.
Produces standalone native executables for Linux ELF64 and Windows PE64.
struct Point {
x: int,
y: int
}
fn hypot_squared(p: Point): int {
return p.x * p.x + p.y * p.y;
}
fn main() {
print_str("Hello from Rubix!\n");
let pt = Point { x: 3, y: 4 };
let dist = hypot_squared(pt);
print(dist); // Prints: 25
let pi: float = 3.141592;
print(pi * 2.0); // Native SSE2 float math
return 0;
}
Why choose Rubix over industry standards like C, Zig, or Rust?
libc, musl, or C runtimes. They talk directly to the OS kernel via Linux syscall or resolve Windows APIs by walking the PEB in memory.You can verify the sub-millisecond compilation time and tiny binary footprint directly on your machine:
# 1. Verify the tiny compiler binary footprint:
ls -lh rubix_compiler
# (Unstripped: ~64 KB | Stripped: ~49 KB)
# 2. Benchmark compile time on a comprehensive program:
time ./rubix_compiler examples/large_system_test.ix /dev/null
# Output: real 0m0.001s (instant sub-millisecond execution)
.ix File Format & Identity
Every Rubix program is authored in the sovereign
.ix file format. Designed for pure systems-level performance, .ix source files are converted directly to native machine code by rubix_compiler and orchestrated via the ./rubixc driver. The official .ix file badge reflects Rubix's sharp geometric lineage and uncompromising fidelity to native hardware.
as + ld). No external dependencies or runtime libraries are needed..ix code into standalone native executables equipped with an adaptive assembly runtime.syscall dispatch for file I/O, process exit, and 64 KB arena bump allocation.-t windows): Dynamic Process Environment Block (gs:[0x60]) resolver that walks kernel32.dll export directories without requiring import libraries (.lib) or MinGW.for and while loops with break, continue, and arbitrary nestingalloc, free) with a high-performance 64 KB arena sub-allocatorstruct declarations, heap instantiation, and field mutation without name collisionsfloat) with SSE2 native arithmetic and relational comparisonsarr[i] = val) and array literal syntax ([1, 2, 3])import "lib.ix")jo __rubix_overflow_error)^) +-----------------------------------+
| Rubix Source Code (.ix) |
+-----------------------------------+
โ
โผ
+---------------------------------------------------------------------------------+
| rubix_compiler |
| |
| [Lexer (src/lexer.s)] |
| โข Tokenizer converting source buffers into structured 32-byte token records |
| โ |
| โผ |
| [Parser (src/parser.s)] |
| โข Recursive descent parser with Pratt-style operator precedence |
| โข Handles scopes, statements, expressions, control flow, loops & imports |
| โ |
| โผ |
| [Symbol Table (src/symtab.s)] |
| โข Lexical block scoping (up to 64 depth) and stack offset calculation |
| โข Variable redeclaration guards and symbol lookup |
| โ |
| โผ |
| [Code Generator (src/codegen.s)] |
| โข Emits native x86-64 GNU assembly (.intel_syntax noprefix) |
| โข Generates .rodata string literals & links embedded assembly runtime |
+---------------------------------------------------------------------------------+
โ
โผ
+-----------------------------------+
| x86-64 Assembly (.s) |
+-----------------------------------+
โ (as + ld)
โผ
+-----------------------------------+
| Universal Native Executable |
| (Direct Syscalls / No C / No VM) |
+-----------------------------------+
โ
โโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโ
โผ โผ โผ
[Host: Linux] [Host: Windows] [Host: macOS]
Direct Linux Dynamic kernel32 Direct Darwin
Syscalls PEB Export Resolver Syscalls
project 2.0/
โโโ Makefile # Compiler build automation
โโโ rubixc # User-friendly compiler & runner script
โโโ test.sh # Complete 14-test verification suite
โโโ src/ # 100% Pure x86-64 Assembly Source Code
โ โโโ main.s # Entry point (_start), command line parser, file pipeline
โ โโโ constants.s # Linux syscall numbers, token types, buffer capacity limits
โ โโโ strings.s # String length, compare, copy, and integer conversion routines
โ โโโ io.s # Raw kernel file I/O & Rust-style diagnostic error reporting
โ โโโ lexer.s # Tokenizer & scanner (keywords, identifiers, literals, operators)
โ โโโ symtab.s # Lexical scope stack, symbol table buffer, and stack offsets
โ โโโ codegen.s # Instruction emitters, rodata manager, and standard library runtime
โ โโโ parser.s # Recursive-descent parser, operator precedence, and loop frames
โโโ examples/ # Test & Demonstration Programs
โโโ 01_hello.ix # Hello World string literal output
โโโ 02_arithmetic.ix # Expressions, operator precedence, and variables
โโโ 03_control_flow.ix# While loops, if-else chains, and reassignments
โโโ 04_functions.ix # Multi-parameter functions and recursive Fibonacci
โโโ 05_prime_numbers.ix# Prime number sieve demonstrating nested logic
โโโ 06_arrays.ix # Dynamic heap allocation, indexing, and array literals
โโโ 07_types_and_logic.ix # Booleans, chars, logical operators (&&, ||, !), optional types
โโโ 08_many_params.ix # Unbounded 8-parameter function caller/callee stack passing
โโโ 09_modules.ix # Multi-file module import system
โโโ 10_safe_math.ix # Hardware integer overflow detection trap
โโโ 11_for_loops.ix # Complete for loops (break, continue, nesting, dynamic arrays)
โโโ 12_stdlib.ix # Embedded stdlib (File I/O, string manipulation, math routines)
โโโ large_system_test.ix # 200-element Quicksort, 4x4 matrix multiplication, and multi-file math
โโโ comprehensive_large_test.ix # Grand stress test: 1,000-element Sieve, binary search, prefix sums
Rubix is statically typed with 64-bit integer primitives (int, bool, char). Type annotations are optional:
let count = 10; # Inferred 64-bit int
let flag: bool = true; # Explicit bool
let symbol: char = 'R'; # Character literal
Supports full precedence: (), !, - (unary), *, /, %, +, -, <, <=, >, >=, ==, !=, &&, ||.
All arithmetic operations detect hardware overflow and terminate safely:
let x = (10 + 5) * 2 - 4 / 2; # Precedence respected
let valid = (x > 10) && (!flag || x < 100);
break and continuefor loops support <init>; <cond>; <step>, empty clauses, nested loops with isolated stack frames, and control jumps:
for (let i = 0; i < 20; i = i + 1) {
if (i >= 15) {
break; # Exits loop early
}
if (i % 2 == 0) {
continue; # Skips to step clause (i = i + 1)
}
print(i); # Prints 1, 3, 5, 7, 9, 11, 13
}
Direct interaction with the Linux memory manager via alloc and free (mmap/munmap):
# Dynamic array allocation
let size = 100;
let arr = alloc(size * 8);
for (let i = 0; i < size; i = i + 1) {
arr[i] = i * i;
}
print(arr[9]); # Prints 81
free(arr, size * 8);
# Array literal initialization
let primes = [2, 3, 5, 7, 11, 13, 17];
print(primes[4]); # Prints 11
Functions adhere to the AMD64 System V ABI. When more than 6 arguments are supplied, additional arguments are seamlessly spilled and retrieved from the stack frame:
fn compute_sum(a: int, b: int, c: int, d: int, e: int, f: int, g: int, h: int): int {
return a + b + c + d + e + f + g + h;
}
fn main(): int {
let sum = compute_sum(1, 2, 3, 4, 5, 6, 7, 8);
print(sum); # Prints 36
return 0;
}
Split code across multiple files with automatic cycle prevention and deduplication:
import "examples/math_lib.ix";
fn main(): int {
let result = compute_cube(5);
print(result); # Prints 125
return 0;
}
Every Rubix binary includes a built-in standard library with zero external runtime requirements:
| Module | Function | Description |
|---|---|---|
| I/O | print(val) |
Prints a 64-bit signed integer followed by a newline |
print_str(expr) |
Prints a static or dynamic null-terminated string | |
print_char(c) |
Prints a single ASCII character | |
| File I/O | file_open(path, flags, mode) |
Calls Linux sys_open (syscall 2) |
file_read(fd, buf, count) |
Calls Linux sys_read (syscall 0) |
|
file_write(fd, buf, count) |
Calls Linux sys_write (syscall 1) |
|
file_close(fd) |
Calls Linux sys_close (syscall 3) |
|
| Strings | str_len(s) |
Returns length of null-terminated string |
str_cmp(s1, s2) |
Compares strings (0 if equal) |
|
str_copy(dst, src) |
Copies source string into destination buffer | |
str_cat(dst, src) |
Concatenates source onto destination buffer | |
puts(s) |
Writes null-terminated string to stdout | |
| Math | math_abs(x) |
Absolute value |
math_min(a, b) |
Minimum of two integers | |
math_max(a, b) |
Maximum of two integers | |
math_pow(base, exp) |
Integer exponentiation ($base^{exp}$) | |
math_sqrt(n) |
Integer square root ($\lfloor\sqrt{n}\rfloor$) | |
| Memory | alloc(bytes) |
Allocates memory via sys_mmap (syscall 9) |
free(ptr, bytes) |
Releases memory via sys_munmap (syscall 11) |
Rubix binaries break the operating system barrier by incorporating an adaptive native runtime:
_start, _start_linux, _start_windows, and _start_macos. The host kernel's loader jumps directly to its corresponding entry vector.rubix_host_os (1 = Linux, 2 = Windows, 3 = macOS).__rubix_sys_write: Linux sys_write / Windows WriteFile / macOS 0x2000004__rubix_sys_read: Linux sys_read / Windows ReadFile / macOS 0x2000003__rubix_sys_open: Linux sys_open / macOS 0x2000005__rubix_sys_close: Linux sys_close / macOS 0x2000006__rubix_sys_mmap: Linux sys_mmap / Windows VirtualAlloc / macOS 0x20000c5__rubix_sys_munmap: Linux sys_munmap / Windows VirtualFree / macOS 0x2000049__rubix_sys_exit: Linux sys_exit / Windows ExitProcess / macOS 0x2000001gs:[0x60]), locates kernel32.dll, and resolves API exports without relying on external DLL import tables.[!NOTE] Platform & Cross-Compilation: Rubix natively targets both Linux ELF64 and Windows PE64 (
.exe) platforms directly from GNUldwithout external dependencies. The multi-OS entry vectors and Windows PEB resolver are verified on host systems.
f64 / Double Precision) & Type SystemFull IEEE-754 64-bit double-precision support with type-aware symbol table resolution, native SSE2 machine code emission (addsd, subsd, mulsd, divsd), and polymorphic print():
let pi: float = 3.141592;
let rad = 2.5;
// Native SSE2 arithmetic (+, -, *, /) and mixed int-float operations
let area = pi * rad * rad;
print(area); // 19.634950 (automatically dispatches to float formatting)
// Typed function parameters and return types
fn hypot(a: float, b: float): float {
return a * a + b * b;
}
Built-in math routines (float_add, float_sub, float_mul, float_div, float_to_int, int_to_float, print_float) remain fully available for backwards compatibility.
User-defined compound data structures with compile-time offset layout, heap instantiation, and member access/mutation:
struct Vector3 {
x: int,
y: int,
z: int
}
fn main() {
let v = Vector3 { x: 10, y: 20, z: 30 };
print(v.x);
v.z = v.x + v.y;
print(v.z); // 30
free(v, 24);
return 0;
}
gdb / lldb)The compiler generates native DWARF .file and .loc debug directives mapping machine instructions directly back to .ix source lines:
./rubixc -g examples/01_hello.ix -o hello_dbg
gdb ./hello_dbg
# (gdb) break 3
# (gdb) run
# Breakpoint 1, main () at examples/01_hello.ix:3
Produce real 64-bit Windows console executables directly on Linux:
./rubixc -t windows examples/01_hello.ix -o hello.exe
file hello.exe
# hello.exe: PE32+ executable for MS Windows 5.02 (console), x86-64
Compile individual .ix files into ELF relocatable objects (.o) and link multiple units:
./rubixc -c module1.ix -o module1.o
./rubixc -c module2.ix -o module2.o
./rubixc module1.o module2.o -o my_app
Rubix produces clear, informative compile-time diagnostics pointing directly to the offending token:
Rubix Compiler Error: Expected expression
--> line 4
|
4 | let x = ;
| ^
as) and Linker (ld) (available via standard binutils)make clean && make
Produces rubix_compiler (the standalone ~42 KB binary).
[!TIP] Prebuilt Binaries: If you don't want to build from source, standalone prebuilt binaries for Linux x86-64 are available on the GitHub Releases page.
Use the ./rubixc compiler driver:
# Compile and immediately run
./rubixc -r examples/15_floats.ix
./rubixc -r examples/16_structs.ix
./rubixc -r examples/17_native_floats.ix
./rubixc -r examples/18_compiler_fixes.ix
# Compile for Windows PE64
./rubixc -t windows examples/01_hello.ix -o hello.exe
# Compile with DWARF debug info
./rubixc -g examples/01_hello.ix -o hello_dbg
./test.sh
Executes all 19 test suites verifying the compiler build, arithmetic, control flow, functions, prime algorithms, dynamic arrays, modules, loops, standard library, floats, structs, native float SSE2 operators, Windows cross-linking, separate compilation, and compiler bug fixes.
src/*.s):rubixc_bootstrap/):.ix). Currently an early prototype (~1,000 lines), with active work being tracked in Issue #1 to achieve full self-hosting.Created with precision in pure x86-64 Assembly. Free and open source under the MIT License.
> A sovereign systems programming language whose entire compiler is written in 100% pure x86-64 assembly. > Zero libc. Zero C.