Xo 0.21 release notes
Introduction
Xo 0.21 builds Intel Mac programs with Xo’s own backend and no C
toolchain, makes native binaries smaller, brings dbg to every backend,
adds Int word methods and lookup commands for agents, and makes TLS and
HTTP cheaper.
Changes to the language
dbg(expr)works on every backend and in--no-gcbuilds, and--releasestrips it (decision 0265).- Int’s word operations are methods that compile to inline operations:
wrapping_shl,shr_logical,rotate_right,rotate_right32,swap_bytes,mul_hi_unsigned,lt_unsignedandle_unsigned, next to the existingwrapping_add,wrapping_subandwrapping_mul(decision 0260).
Tools
- Lookups for agents:
xo def,xo refs,xo type,xo docandxo symbols(decision 0261). - Miscompile triage:
XO_PASSESturns optional optimization passes off by name, andxo dev bisect-passfinds the first pass whose build behaves differently. Property tests reduce a failing case automatically. xo test --std-moduleruns a standard library module’s own tests (decision 0262).XO_POISON_FRAMESfor finding reads of stale stack memory.- Test programs no longer outlive their tests: each runs in its own process group.
xo vetwarns about large copies withXO0530(decision 0263).
Compiler
- Native builds drop every function nothing calls.
hellois 26.5% smaller, and the JSON, HTTP and TLS servers 13.5 to 16.7% smaller on an Apple silicon Mac, smaller than LLVM’s builds.xoitself went from 57 MB to 42 MB. - Tuple folding after inlining: HTTP/2 11.5% and TLS 8.9% fewer instructions per request.
- Fixes to range analysis, including a crash on an empty interval.
Standard library
- Bytes from outside the program that are not valid UTF-8 become a valid
Strat every boundary (decision 0259). - TLS handshakes are 13.9% cheaper on arm64 and 22% on x86-64; HTTP/2 is 11.6% cheaper, and more from moving reference counted payloads. P-256 and X25519 are faster.
Ports
- Intel Macs: Xo’s own x86-64 backend now targets
darwin/amd64, with its own Mach-O assembler (objects byte identical to clang’s) and linker. All 193 test programs pass on an Intel Mac with no C toolchain (decision 0254). - Windows: Xo’s own calls on Windows will use the System V convention, decided for the coming windows/amd64 port.