Xu 0.16.0 Released: Top-of-File const Rule, Batches Q–T, SIMD/Span/Media, ESP32-C3 & Kernel Primitives
Xu 0.16.0 is officially released! This release enforces a clean top-of-file placement rule for module-level const declarations, lands compiler, MIR, and runtime optimization Batches Q–T across ARM64, x86-64, LoongArch64, and RISC-V, introduces #simd, zero-copy #bytes/span, #bytes/aligned, #gpu/video, #ffi/dl, and #os/mmap, expands ESP32 & ESP32-C3 (RV32) ELF32 object emission, and deepens freestanding #core drivers and kernel traps.
See the Xu 0.15.0 release notes for the preceding legacy or removal and Batches A–P milestone, and inspect the updated program structure guide, OS development guide, and API reference.
1. Breaking Language Change: Top-of-File const Placement
- Unified Module Header Ordering: The parser now enforces that module-level
constdeclarations appear after package tags and imports, and strictly abovefn,struct,enum,interface,impl, and module-levelletdeclarations (PR #319). - Diagnostics & Tooling: Clear parser diagnostics, updated
xu-lspsupport, andscripts/check_const_placement.pyenforcement keep compiler sources, standard library, and companion packages (xulang-org/packages) consistent.
2. Compiler, MIR & Runtime Performance (Batches Q–T)
- Lock-Free Concurrency & Modular M:N Scheduler: Added lock-free MPMC channel rings, a modular standalone M:N scheduler with lock-free
runq/gfreeand persistent netpoller, Stage-3 M:N I/O and wake/steal tuning (PR #313), MT timer parking, POSIXkqueue/signalfdsignal handling, and Windows 1 MiB guarded stack cache capping. - Vectorization, BCE & Register Allocation: Landed ARM64 30-FP register allocation and FP spill support, fanout-scored loop promotion, SLP multi-use DAG vectorization with forward chain climbing, bottom-tested loop BCE, parameter-slice scope LICM/BCE, cold-push loop helper inlining, hardened
opt_ptr_sralias checks (PR #315), BCE GVN,xuobjrelocations (PR #314), FFI GOT offset expansion (2048 -> 2560), Loong64/RV64A atomics, and seeded map hashing.
3. SIMD, Zero-Copy Span, Media & Dynamic FFI
- Hardware Vectors & Spans: Added NEON/SSE2 primitives in
#simd, zero-copy views in#bytes/spanand#bytes/aligned, memory mapping in#os/mmap, and dynamic loading primitives in#ffi/dl. - Media & Headless GPU Compute: Added
#gpu/videopipeline utilities and headless GPU compute support (PR #309).
4. Embedded ESP32 / ESP32-C3 (RV32) & Freestanding #core
- ESP32 & ESP32-C3 (RV32): Added ELF32
ET_REL--emit-objemission,c_call6,rom_callback, and bare-heap counters; expandedexamples/esp32/idf_cydwith an ESP32-C3 target, Kconfig panel wiring, narrow UI layout, and NFC NDEF tools (PR #317), and addedexamples/esp32/xu_flipper(PR #318). - Kernel & Storage Drivers: Added x86-64 bare-metal baseline, ARM64/RV64 SMP and EL0/U-mode trap trampolines, RV64 nested traps, ARM64/RV64 FP trap register save,
--no-fpvector gating,#core/nvme,#core/ahci,#core/rtc,#core/xhci, VirtIO-GPU 2D,VirtioPciRng, ECAM MSI-X, FAT32/ext2 (including double-indirect)/USTAR tar, and TCP server/RST/retransmit/DNS support.
5. Standard Library Hardening & #flag Extensions
- Security & Hot-Path Fixes: Hardened and optimized
#crypto(TLS/X.509/GMTLS/JWT/RSA/Ed25519/SM9/SHA3/Poly1305/GCM/PBKDF2),#net/#net/http/#database/sql,#encoding/#compress/#image/#regexp(decompression-bomb & ReDoS guards, fast float/JSON/PNG/JPEG/CRC),#ui/#gpu(WebView XSS checks, font layout,ByteBuildercapacity reservation), and XACP XUN v0.2.0-dev smoke coverage (PR #310, PR #316). - Extended CLI Flags: Added
allow_unknown, colon fallback, repeatable string lists, ordered events, andparse_fromto#flag(PR #312), alongside academic citations and acknowledgments in the project READMEs.
6. Benchmarks (Verified 6-Platform v0.16.0 Run)
Measured across all 121 canonical workloads on six platforms in xulang-org/bench Actions Run #46208668702 (Xu commit 9b7d2689, 2026-11-29), with 0 Xu failures across 121 × 6 = 726 runs (xu_failed_cases = 0; on Windows ARM64, peer rustc -O3 hit one transient socket buffer failure WSAENOBUFS on http_concurrent while rustc -O1/-O2 passed). Ratios represent Xu / best peer median (minimum across O1/O2/O3 for Clang and rustc); lower is faster:
| Platform | Coverage | vs Clang Geomean / Median (Wins) | vs rustc Geomean / Median (Wins) | vs Go Geomean / Median (Wins) | vs Swift Geomean / Median (Wins) |
|---|---|---|---|---|---|
| macOS ARM64 | 121 / 121 | 1.010× / 1.093× (37/116) | 0.901× / 1.012× (56/120) | 0.606× / 0.744× (100/121) | 0.462× / 0.654× (107/116) |
| Linux ARM64 | 121 / 121 | 0.834× / 0.999× (59/116) | 0.753× / 0.982× (69/120) | 0.519× / 0.704× (106/121) | 0.356× / 0.544× (106/114) |
| Windows ARM64 | 121 / 121 | 0.927× / 0.984× (66/116) | 0.859× / 0.948× (87/120) | 0.691× / 0.767× (112/121) | — |
| macOS x86_64 | 121 / 121 | 0.961× / 1.065× (46/116) | 0.859× / 1.033× (51/120) | 0.666× / 0.806× (92/121) | 0.398× / 0.592× (99/116) |
| Linux x86_64 | 121 / 121 | 0.883× / 1.024× (54/116) | 0.807× / 1.002× (60/120) | 0.553× / 0.763× (92/121) | 0.351× / 0.565× (96/114) |
| Windows x86_64 | 121 / 121 | 0.932× / 1.022× (50/116) | 0.868× / 0.992× (66/120) | 0.650× / 0.766× (101/121) | — |
Representative workload medians across domains (ratios vs. same-platform best Clang O1–O3 in parentheses; explore all 121 workloads on the Benchmarks dashboard):
| Workload | macOS ARM64 | Linux ARM64 | Windows ARM64 | macOS x86_64 | Linux x86_64 | Windows x86_64 |
|---|---|---|---|---|---|---|
startup | 7.83 ms (1.24×) | 0.33 ms (0.57×) | 14.36 ms (0.95×) | 4.38 ms (0.60×) | 0.33 ms (0.45×) | 7.24 ms (0.89×) |
loop_sum | 9.78 ms (0.79×) | 0.36 ms (0.03×) | 15.00 ms (0.54×) | 9.69 ms (0.45×) | 0.29 ms (0.04×) | 4.52 ms (0.42×) |
fib | 27.97 ms (0.93×) | 11.12 ms (0.88×) | 24.99 ms (0.92×) | 38.64 ms (1.19×) | 20.39 ms (1.11×) | 21.27 ms (1.05×) |
matmul | 9.86 ms (0.90×) | 6.25 ms (0.73×) | 20.40 ms (0.97×) | 14.16 ms (0.75×) | 7.96 ms (1.04×) | 14.01 ms (0.86×) |
sieve_primes | 11.49 ms (0.95×) | 17.20 ms (1.05×) | 23.87 ms (0.95×) | 49.24 ms (0.92×) | 14.87 ms (1.05×) | 18.10 ms (1.02×) |
sha256_chain | 5.16 ms (0.80×) | 0.68 ms (0.37×) | 15.37 ms (0.94×) | 15.79 ms (1.25×) | 0.70 ms (0.34×) | 5.92 ms (0.80×) |
aes128_encrypt | 10.18 ms (0.21×) | 1.80 ms (0.07×) | 16.48 ms (0.35×) | 12.67 ms (0.15×) | 1.65 ms (0.09×) | 5.78 ms (0.21×) |
scimark_fft | 10.50 ms (1.50×) | 5.91 ms (1.20×) | 20.61 ms (1.04×) | 12.86 ms (1.41×) | 6.64 ms (1.46×) | 11.04 ms (1.22×) |
btree_index | 29.91 ms (1.19×) | 22.12 ms (1.15×) | 35.06 ms (1.03×) | 29.79 ms (0.96×) | 27.29 ms (0.96×) | 28.61 ms (0.94×) |
sql_query_exec | 47.85 ms (1.21×) | 37.57 ms (1.37×) | 50.47 ms (1.27×) | 60.67 ms (1.32×) | 59.43 ms (1.53×) | 70.44 ms (1.57×) |
expr_bytecode_vm | 19.66 ms (1.49×) | 11.25 ms (1.16×) | 26.25 ms (1.03×) | 23.42 ms (0.51×) | 7.74 ms (1.04×) | 12.35 ms (1.13×) |
chan_ping | 19.81 ms | 24.02 ms | 36.56 ms | 30.24 ms | 22.44 ms | 27.25 ms |
7. Upgrade & Downloads
Upgrade compiler, standard library, and SDK tools together from the Download center or GitHub Releases v0.16.0, and verify SHA256SUMS. If your modules declare top-level const items below fn/struct/enum/let declarations, move those const declarations to the top of each file after imports.