Xu 0.12.6: complete C FFI & xu cbind, Phone game host, memory-safety gate, and optimizer gains
Xu 0.12.6 delivers a complete cross-architecture C FFI stack with automated header generation, native SDL GPU mobile game packaging, an expanded Zero-GC memory-safety verification gate, and a broad wave of MIR optimizer, x64/ARM64 codegen, and runtime hot-path optimizations.
Complete C FFI and xu cbind
C interoperability now covers full object, application, and native library linking across ARM64, x64, RISC-V, and LoongArch backends. New language and ABI features include C unions and bitfields, extern globals, C closure callbacks with trampoline dispatch, and improved FFI diagnostics. The new xu cbind subcommand emits C header declarations together with compile-time layout assertions directly from Xu FFI surfaces.
Native Phone Game Host and #app
Mobile packaging now supports xu build --phone --phone-profile game alongside the existing UI profile. The new #app standard-library module and updated xu-phone / xu-native templates package native SDL GPU mobile games with embedded resources, an ARM64 stack-switching runtime host, and safe-area, back-key, and resume lifecycle events.
Memory Safety and Zero-GC Hardening
Static borrow, move, and unsafe enforcement has been tightened across containers, generics, closures, match/select/or paths, and xu coroutine spawns. MIR lowering and the runtime add copy-on-write string byte writes, immortal static headers for boxed zero-sized structs, 16KB guard pages on task stacks, integer overflow traps, and a self-contained 67-check memsafe-gate suite running in CI under XU_DEBUG_FREE=1.
MIR Optimizer, Codegen, and Runtime Performance
- x64 backend: XMM register allocation with direct SSE2
f64lowering,cmp+cmovccselect fusion, andmul 3/5/9andadd/sublowering tolea. - ARM64 & shared codegen: power-of-2 parity/division simplification,
mul 2^k+1andcmp+cselfusion, and compound||/&&fast-entry guards. - Typed-MIR passes: dominator range-bound propagation and div/cmp folding in
opt_gvn, inclusive<=loop versioning inopt_bce, small constant-trip loop unrolling inopt_ifconv, local-backed switch lookup tables, and zero-environment function-value devirtualization. - Runtime hot paths: accelerated Base64 encoding/decoding, string operations, and MD5 block compression and hex formatting in
runtime/core.
Upgrade the full SDK
All six native platform SDKs (Linux x64/arm64, macOS arm64/x64, Windows x64/arm64) passed full self-host fixed-point verification, runtime/package protocol tests, and the 67-check memory-safety gate.