Xu 0.9.4
Xu 0.9.4 is a compiler consistency and optimizer release for the official self-hosted toolchain. Download SDKs, native single-file Setup installers, checksums, and release assets.
Type Checking & Borrow Checking
- Complete Expression Coverage: The borrow checker now walks every expression kind, with a conservative fallback for unknown kinds. Aliasing such as
f($&v, &v)is reported even when the call is nested inside a cast or arithmetic expression, for exampleint(f64(f($&v, &v)) * 32.0). - Loop-Carried Borrows: Borrows taken inside a loop body stay live across the loop back edge, so a conflict with a borrow from the previous iteration is diagnosed.
- Generics Without a Parameter Cap: Generic declarations are no longer limited to four type parameters.
- Explicit Limits: Type-id range overflow is asserted instead of silently wrapping, and backends that do not support a requested target fail with a clear error.
Migration note: programs that previously compiled only because of these gaps now receive a borrow diagnostic. Pass separate values, or finish the mutable use before taking the shared borrow.
MIR Verification & Diagnostics
- Per-Pass Verification:
XU_VERIFY=1runs the full MIR verifier after every optimization pass. Mismatches between the verifier, lowering, and the backend found this way were fixed. - MIR Dump:
XU_DUMP_MIR=<fn>prints the MIR of a named function. - Pattern Hits:
--timingsreports which named backend patterns fired (pattern-hits:) and the register-allocation mode chosen for each function.XU_PATTERNS_OFFdisables named patterns for differential testing.
SSA Loop Optimization
- No Shape Whitelist: Scalar SSA promotion no longer depends on a per-shape whitelist; every function that passes the escape, SSA, and verifier checks is eligible.
- SSA-Based ARM64 Loop Kernels: scan, saxpy, CRC, binary search, fill, stride, and predicated-scan kernels match on SSA form, and superseded slot-based matchers were removed.
- Loop Rotation:
whileloops bounded by the length of an[]intare rotated so they qualify for these kernels; string and byte loops keep the shape the byte-pattern matchers expect.
Local A/B measurements on macOS ARM64 against 0.9.3 show bloom_filter about 12% faster, chase_index 9–11%, f64_sum about 8%, and algorithm_search about 9% at -O3, with no regressions; self-compilation is also slightly faster. The benchmarks dashboard now includes 47 workloads measured with 0.9.4 across all six platforms, with verified compiler identities, bootstrap fixed points, and program output. See the source CI run for provenance.
Installation & Migration
- macOS / Linux One-Line Online Install:
curl -fsSL https://xulang.org/install.sh | bash - Windows PowerShell One-Line Online Install:
irm https://xulang.org/install.ps1 | iex - Standalone Setup Binary: Run
./xu-setup-<target> -y(or double-clickxu-setup-windows-x64.exefor GUI wizard on Windows).
In your project manifest xu.xun, declare:
module: myapp
version: !ver 0.1.0
xu: !ver 0.9.4
Run xu --version to verify compiler version 0.9.4.