Toolchain
Xu 0.16.0 provides build, run, check, test, install, fmt, map, doc, and doctor. Product builds self-host with the Xu compiler; the frozen Rust bootstrap serves as a primer and correctness oracle.
Build, run, and test optimize by default. Pass --no-opt to disable optimization. The XACP control channel is enabled explicitly with --xacp or --xacp-port. Native stdio and loopback TCP were exercised in the release tests.
The default target is the host. Use --target linux-arm64 or XUOS/XUARCH for cross-compilation. XUPATH uses : on Unix and ; on Windows, independently of the target. External imports still require xu.xun mappings.
Ordinary AOT builds emit native output directly. Use --emit-obj for XUOBJ files and --target wasm32-wasi for WASI modules. Desktop host code and native extensions such as SQLite require their platform toolchains.
Native Inputs & .a / .xulib Specification
When compiling executables, xu build and xu run support accepting native static archives on the command line or declaring module mappings in the native: section of xu.xun:
1. Command-line native archive linking:
xu build main.xu module.a -o main
xu build main.xu module.xulib -o main
2. Or declared in project manifest xu.xun:
native:
sqlite_native: file:./native/sqlite.xulib
The toolchain natively supports both standard generic .a (Unix static archives) and portable .xulib multi-target slice containers:
- Generic
.aArchives: Directly linked on a single platform, suitable for local development and debugging. The archive embeds an object slice (xu.o) containing export signatures, linked by the platform host linker. - Portable
.xulibContainers: Designed for cross-platform ecosystem distribution. While generic.aarchives are tied to a single architecture and lack parameter/return type contracts,.xulibbundles a strongly-typed JSON Manifest alongside standard.aslices for all target platforms. Duringxu build, the compiler selects the matching slice by--target, verifies its SHA-256 digest, enforces static type constraints, and produces zero-overhead native machine code.
The top-level compiler command xu native provides compile (C compilation with injected metadata), archive (packaging precompiled objects), pack (bundling slices into .xulib), inspect (container inspection), and extract (slice extraction). Run xu doctor to inspect host linker and C toolchain availability.
CLI options · Dependencies and frozen builds · Native modules & .xulib