From C / C++
You tune for the metal and you pay for it in headers, macros, build scripts, and aliasing rules. Rasmalai keeps the optimizer and the ABI, and deletes the rest.
No headers, no macros, no CMake
One binary replaces the toolchain sprawl — build, test, format, lint, and docs ship together:
// C++: CMakeLists.txt + vcpkg.json + headers + TUs, then wait
// cmake -B build -DCMAKE_BUILD_TYPE=Release && cmake --build buildrnx build --release
rnx test
rnx fmtVectors without intrinsics headers
No <immintrin.h>, no _mm_add_ps spelling bee, no alignment attributes to get wrong. The type is the instruction:
import { Vec4f } from "@std/simd";
let a = new Vec4f(1.0, 2.0, 3.0, 4.0);
let b = Vec4f.splat(2.0);
let c = a * b;
print(c.x(), c.w()); Bounds checked, then proven away
Out-of-bounds indexing traps instead of reading your neighbor's secrets. Then Bounds Check Elimination hoists the proof out of hot loops, so the safety costs nothing at -O3:
Allocation without malloc/free
Heap arrays are refcounted values with destructors the compiler writes. There is no new without delete, because there is no manual pairing at all:
Keep the -O3 and the pointer-free hot loop. Lose the undefined behavior. Next: the Guide from the top, or the Manual for exact memory semantics.
fn total(n: Int): Int {
let arr: Array<Int> = [];
let i = 0;
while i < n {
arr.push(i);
i = i + 1;
}
let sum = 0;
for x in arr {
sum = sum + x;
}
return sum;
}
print(total(5));