Repository navigation
v0.5.0
Rul (.rl) v0.5.0 — Turing-Complete Core (60-Opcode ISA)
Milestone 1 (v0.5.0) takes Rul from a 29-opcode columnar SIMD compute engine to a 60-opcode Turing-complete 128-bit binary programming language with zero-LLVM microsecond Linux x86_64 ELF64 compilation, single-pass O(N) verification, host-independent fail-closed recursion/stack bounds, and a linear-scan scalar register allocator that beats the <= 2.0x vs rustc -O performance gate across all five exit programs.
Highlights
-
Structured Control Flow, Typed Scalar Locals &
CAP_DIVERGE(v0-5-tc-core-1, PR #20)- Added WASM-style single-pass structured control flow (
Block,Loop,If,Else,End,Br,BrIf),ConstI64, and 64 definitely-initialized typed scalar locals (LocalGet,LocalSet) withBlockSig/LoopBoundwitnesses. - Termination as a Capability Policy (
CAP_DIVERGE = 0x08): WithoutCAP_DIVERGE, everyLooprequires a verifiedLoopBoundproof and recursive calls are rejected at load time (guaranteed termination for sandboxes/UDFs). WithCAP_DIVERGE, unbounded loops and general recursion are permitted.
- Added WASM-style single-pass structured control flow (
-
I64/U8Arithmetic, Declared Growable Regions & Byte I/O (v0-5-tc-core-2, PR #21)- Added
ElemType::U8, bitwise/shift/cast/checkedDiv/Rem,CmpLtU, andMaskNotwith deterministic fail-closed traps (exit 72int div/rem error,exit 73cast out of range). - Added statically declared growable regions (
RegionDecl,RegionNew,RegionGrow,RegionLen,RegionLoad,RegionStore,RegionFree) backed by LinuxSYS_mmap/SYS_mremap/SYS_munmap, declarative byte input/output regions (u8:input/u8:output), default runtime bounds checks (exit 71), andRegionIndexInBoundsproof-based bounds-check elision.
- Added
-
Modular Function Table, Recursion, Host-Independent Stack Budget & Brainf*ck Proof (
v0-5-tc-core-3, PR #22)- Added
Func..Endmodular scopes (Func,Return,Call,CallArg,ProofRuleKind::FuncSig = 5) with function-id indexing (>255 functions, >65,536 total nodes) and function-relative node operands. - Enforced host-independent deterministic limits (
MAX_CALL_DEPTH = 4096,MAX_STACK_UNITS = 1 << 20, privatemmapstack with bottomPROT_NONEguard page, fail-closedexit 75even underulimit -s 64). - Shipped all five
v0.5exit programs passingTier 0 == ELF64 AOTbit-for-bit: Brainf*ck interpreter, recursivefib, in-placequicksort, primesieve, and FIPS 180-4sha256.
- Added
-
Single-Pass Linear-Scan Scalar Register Allocator & Performance Gate (
v0-5-tc-core-4, PR #23)- Replaced the one-stack-slot-per-node structured emitter in
src/aot.rswith a single-pass linear-scan allocator over 10 GPRs (rdi/rsi/rdx/rcx,rbx/r12/r13/r8/r9/r10) and 14XMMregisters (xmm2..=xmm15), reusing spill slots strictly within8 * func_frame_units(f)bytes. - Codegen Linearity:
stress_6k(6,000 nodes) compiles in158–190 µs(26–32 ns/node) andstress_60k(60,000 nodes) in1.60–1.93 ms(27–32 ns/node,~10.1xscaling for 10x nodes). v0.5Exit Performance Gate (ELF64 AOTvsrustc -O, byte-identical stdout,<= 2.0xtarget):Benchmark Rul ELF64vsrustc -OBinary Size Codegen Time fib(40)1.73x–1.98x1,262 B~3.6–4.3 µsquicksort(2MI64s)1.46x2,084 B~6.6–8.5 µssieve(N = 50M)1.13x1,752 B~5.0–6.1 µssha256(64 MiB)1.41x–1.66x5,368 B~23.7–30.1 µsbrainfuck(3x nested loop)1.55x–1.57x2,964 B~8.3–10.0 µs
- Replaced the one-stack-slot-per-node structured emitter in
-
Columnar SIMD Upgrades & Safety Hardening (Phases P0, P1, P1b — PRs #17, #19)
- Linear-scan 256-bit AVX2
YMMregister allocator (ymm2..ymm13) + explicitOpcode::Fma(0x27) (BM-HORNER-50:3.33xfaster than hand-written 8-acc C/Rust,2,877 BELF64 compiled in10.07 µs). - Branchless 4-lane AVX2 + FMA3 vectorized
Ln/Exp(< 1e-13relative error vslibm). - Hardened
ArenaSlice/Gathereffective bounds, exact IEEE-754 integer index validation,SYS_lseekfile-size checks (zeroSIGBUS), and 1 GiB arena input limit.
- Linear-scan 256-bit AVX2
Install Prebuilt Linux x86_64 Binaries
curl -fsSL https://raw.githubusercontent.com/rul-lang/rul/main/install.sh | shOr build from source:
cargo install --git https://github.com/rul-lang/rul --tag v0.5.0 --bins --forceFull Changelog: v0.4.0...v0.5.0