XU XU
中文
XU

XU

Rock-solid memory safety with zero runtime overhead, lightning-fast compilation, and crystal-clear mental model.

Quick Install via Terminal
curl -fsSL https://xulang.org/install.sh | bash -s -- --online --version 0.13.1 --yes
& ([scriptblock]::Create((irm https://xulang.org/install.ps1))) -Online -Version "0.13.1"
Auto CPU Architecture Detection Persistent PATH Registration Standard Library & Full SDK

Supersonic Native AOT & WASM

Zero VM, zero runtime bloat. Directly compiles to native machine binaries and standard WebAssembly (WASM). First-class cross-compilation (macOS, Linux, Windows, WASM) and sub-millisecond cold start.

Zero-Cost Ownership & RAII

No Stop-The-World GC pauses. Unique ownership with deterministic RAII scoping drop; shared &T and exclusive &mut T borrow semantics statically eliminate data races.

Native Coroutines & Channels

First-class language-level concurrency. Spawn lightweight user-space coroutines via xu f() and coordinate across type-safe chan T pipelines, designed for high-throughput modern servers.

Clean & Expressive Syntax

No semicolons, no redundant parens, immutable by default. Intuitive flow symbols: << return, >> throw, or (err) {} catch, <- break, and -> continue for clear readability.

Batteries-Included Toolchain

Unified xu CLI for builds, tests, dependency management (get), editor services (lsp), and C modules (native) with native xu.xun manifests. Rich standard library covering async net/HTTP, cryptography & SM cipher suites, SQL, and desktop WebView.

Deterministic Safety & Zero UB

Eradicate C/C++ silent Undefined Behavior (UB). Strict compile-time null safety, memory bounds checking, and explicit error propagation ensure rock-solid, predictable systems software.

Native Desktop UI & WebView

Built-in 2D drawing, layouts, native widgets, theming, and IME input, alongside HTML/CSS/JavaScript WebView integration for desktop applications.

Unified Tooling & Editor Support

A single xu command line tool for build, run, check, format, and docs with built-in test runners and LSP support for modern editors.

C Interoperability & Native Modules

Compile and package C modules with xu native, using portable .xulib distribution bundles with multi-target slices.

Experience XU in Browser (WebAssembly Playground)

Compile and execute Xu code instantly in your browser without local installation. The runner is written in Xu and self-compiled to WASM, covering lexical analysis, borrow checking, and runtime execution.

playground.xu · Xu Browser Sandbox parse → borrow check → MIR → execute

Start with the entry function and standard output, modify text, and run again.

// Standard output and diagnostics will be shown here...

Explore Core Features

Continue exploring standard library and native execution capabilities with the local compiler.

Error Handling Ownership & Borrowing Generics Coroutines & Channels Concurrent HTTP Services Native UI / WebView

Native & WebAssembly Compilation Targets

The compiler generates code for the following targets. For downloadable SDK archives, see the Download page.

Code generation, SDK availability, and tested runtime behavior are separate levels of support. Runtime and GUI paths without target-machine acceptance results remain unverified. See Status & Limitations and per-package notes; native modules and desktop builds may require host libraries and toolchains.

macos arm64 (Native)macos x64 linux arm64linux x64 linux loongarch64linux riscv64linux arm32 windows x64 (PE AOT)windows arm64 wasm32 (WebAssembly / WASI)

Frequently Asked Questions (FAQ)

What is the Xu programming language?

Xu is a statically typed systems language that compiles ahead of time to native code. It combines ownership and borrow checking with lightweight coroutines and typed channels for command-line tools, network services, and desktop applications.

Does Xu use a garbage collector (GC)?

No. Compile-time ownership and borrow checking govern resource lifetimes, with deterministic cleanup at scope exit and no runtime garbage collector. See Ownership & Borrowing and the FAQ on shared-state synchronization and native/FFI safety boundaries.

Does Xu support native desktop UI?

Yes. The SDK includes native drawing, layout, controls, and desktop services, plus WebView for HTML/CSS/JavaScript interfaces. Native controls need no web page. See the UI FAQ and UI guide for capabilities and platform requirements.

How does Xu perform?

The benchmark dashboard compares Xu, C, Rust, Go, and Swift across 60 groups with 72 workload variants on six ARM64 / x86-64 platforms, with measured runtime, memory, binary size, and source records.

Xu 0.13.1 completes the standard-library zero-stub audit, re-engineers sync.Cond registered waiter queue signaling, implements cross-platform os/exec streaming pipes, and adds HTTPS connection reuse, Windows WSAPoll batch socket polling, and HTTP/2 Huffman decoding.

View all frequently asked questions →