XU XU
XU

Speichersicherer Systemcode.Ohne Garbage Collector.

Xu prüft Eigentum und Ausleihen zur Compile-Zeit und kompiliert Ahead-of-Time in nativen Maschinencode sowie WebAssembly. Deterministische Freigabe, typisierte Kanäle und M:N-Coroutinen — gesteuert über einen einzigen xu-Befehl.

@main
fn square(input chan int, output chan int) {
    for i in 0:5 {
        v := <-input
        output <- v * v
    }
}

fn main() int {
    nums := chan int{cap: 5}
    squares := chan int{cap: 5}
    xu square(nums, squares)
    for v in 1:6 { nums <- v }
    for i in 0:5 { println(<-squares) }
    << 0
}

$ xu run pipeline.xu

1 4 9 16 25

Gemessene Startlast auf macOS ARM64 (Apple Silicon): 81.0 KiB natives Binary · 7.8 ms Median-Laufzeit

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

Gemessen, nicht behauptet

Im Benchmark gegen C, Rust, Go und Swift

Geometrisches Mittel der Median-Laufzeit von Xu geteilt durch die der jeweiligen Vergleichssprache über 121 Workloads auf macOS ARM64 (Apple Silicon), gemessen am 2026-11-29. Unter 1.00× bedeutet, dass Xu schneller war.

Laufzeitverhältnis (geometrisches Mittel)

vs C 1.01×
vs Rust 0.90×
vs Go 0.61×
vs Swift 0.46×

Native Binary-Größenspanne (KiB)

Xu 81–1468
C 16–49
Rust 456–585
Swift 33–77
Go 1789–8041
Vollständiges Benchmark-Dashboard öffnen →

Full-Stack-Systemfähigkeiten: Vom Bare-Metal-Kernel und MCU bis zu lokalem AI & Apps

Eine Sprache und einheitliche xu-Toolchain für AOT-Optimierung, Zero-GC-Speichersicherheit, M:N-Nebenläufigkeit, Embedded-Funkstacks, reines Xu-AI, native UI, Mobile und C-FFI.

Stabile Bare-Metal-Toolchain

Betriebssystem- & Kernel-Entwicklung

Standalone-Kernel und UEFI-Firmware mit --profile=freestanding und xu init --baremetal: 25 #core/*-Module, MMU, VirtIO, GICv3 / PSCI / SBI, @interrupt, @repr("C") und isoliertes unsafe-MMIO.

  • x64-none
  • arm64-none
  • riscv64-none
  • x64-uefi
  • arm64-uefi
Kernel-Leitfaden
4-Schichten-AI-Stack in reinem Xu

AI-Entwicklung, lokale Inferenz & Fine-Tuning

47 #tensor-Primitive und --tensor-fusion K-Quant-SIMD für llm_engine (--threads N, VLM, GBNF/Schema, LoRA/RLVR), llm_metal / cuda_native / vulkan_native sowie MCP, A2A und GraphRAG.

  • GGUF
  • Safetensors
  • #tensor
  • Metal / CUDA / Vulkan
AI- & Inferenz-Leitfaden

Eigener AOT-Compiler, typisiertes MIR & WebAssembly

Ohne LLVM oder externen C-Compiler: Self-Hosting auf 6 Host-Zielen plus LoongArch64, RISC-V, wasm32-wasi und Bare-Metal mit MIR-Batches A–T, SLP, --pgo und Mach-O/ELF/PE-Hardening.

$ xu build app.xu --pgo app.pgo $ xu build app.xu --target wasm32-wasi -o app.wasm Ziele & Implementierungsstatus

Ownership ohne Lifetime-Annotationen & Zero-GC

Compiler-inferiertes Einzel-Ownership mit geteilten (&T) und exklusiven ($&T) Borrows ohne manuelle 'a-Annotationen. Deterministische Freigabe ohne GC-Pausen; *raw T nur in unsafe.

fn push(buf $&[]int, v int) fn sum(buf &[]int) int Speichersicherheitsmodell

Symbolischer Kontrollfluss & ohne Funktionsfärbung

Standardmäßig unveränderlich ohne Semikolons oder Bedingungsklammern; << Return, >> Throw, >>> Fehlerfluss ohne Result/? oder async/await-Färbung.

Fehlerbehandlung & Syntax

M:N-Koroutinen, 16-KiB-Stacks & getypte Channels

Leichte 16-KiB-Koroutinen via xu f() mit standardmäßig aktivem M:N-Scheduler unter Linux/macOS, #sync/pool, SPSC-Eliminierung und select.

Nebenläufigkeitsmodell

Embedded-MCUs, ESP32 & Funkprotokoll-Stacks

Ziele für thumbv7em-none, riscv32imac-none und none-xtensa samt #embedded/{chips/esp32,bluetooth,wifi,display,mqtt} (Wi-Fi/BLE-Koexistenz experimentell).

Embedded- & MCU-API

Async-Netzwerk, reines Xu-TLS 1.3 & Kryptographie

epoll/kqueue/WSAPoll, HTTP/2 Huffman, WebSocket, SOCK_RAW, reines TLS 1.3 + ACME, AES/SHA-NI, SM2/3/4/9/ZUC/GMTLS sowie kontrahiertes #crypto/subtle.

Netzwerk & Kryptographie

Plattformübergreifende GPU, Windowing, UI & WebView

#gpu, #window und #ui/* bieten Headless-GPU-Compute/Render-Pässe, Retained-Layout, 46 Widgets (:focus-visible), 30 Diagramme und WebView2/WebKit.

GPU- & Desktop-UI-Leitfaden

iOS-/Android-Mobile-Apps & GPU-Game-Host

Erzeugt mit xu build --phone ARM64-iOS/Android-Projekte inkl. Safe-Area, IME, Haptik sowie --phone-profile game und #app-Asset-Bundling.

Mobile-Entwicklung

Module, Span-Arena-XUN, SQL & 50 Pakete

Reproduzierbares xu.xun/xu.lock/--frozen + Ed25519 XUSUMDB, Span-Arena-XUN, #database/sql, reines dlopen-SQLite und 50 DB-/AI-Pakete.

50 Erweiterungspakete

Bidirektionale C-FFI, .xulib & #xacp-Kern

Multi-Target-.xulib mit xu native, C-Header via xu cbind, --shared-Libraries (Bitfields/Unions/Callbacks) und #xacp-Steuerungskern (Native-UI unbestätigt).

Native Module & FFI

Einheitliche CLI, DWARF-Debug, LSP & Live-Docs

Eine xu-Binary für Build, Test, debug (LLDB/GDB & DWARF-Typen), symbolische Backtraces, doc --serve, map-Mermaid-Graphen, xu-lsp und GUI-Setup.

CLI-Referenz

Vollständiger Technik-Atlas

Durchsuchen Sie Xu 0.16.0 nach sechs technischen Domänen: Compiler-Pässe, Sprache & Sicherheit, 192 Stdlib-Pakete, Bare-Metal/MCU, AI/GPU und Toolchain.

Compiler-Backend & Optimierungspipeline

Ziele & Status
  • Reiner Xu-Self-Hosting-Fixpunkt Ohne LLVM oder C-Compiler; alle 6 Tier-1-Plattformen bestehen die Self-Hosting-Fixpunktprüfung.
  • Typisierte MIR-Batches A–T IPA ModRef Alias-Verfeinerung, Cold/.okp-Inlining, Heap-/Divisor-BCE und Multi-Push-Reservierung.
  • SIMD-Fusion & Loop-Tiling SLP-Vektorisierung, MEMOIR-GEMM-Tiling & SROA sowie ARM64 NEON/SDOT und x64 SSE2/SSSE3.
  • PGO & Low-Level-Codegen --pgo Ext-TSP Block-Layout, ARM64 LFTR/NZCV-Reuse sowie x64 cmov, MULH und Inline-Atomics.
  • Natives Binary-Hardening Mach-O LC_CODE_SIGNATURE & __DATA_CONST, ELF W^X/PIE/Full RELRO/CET, PE32+ W^X & .pdata.
  • Verifikation & Konformität Pass-Validator XU_VERIFY_MIR=1, XU_DUMP_MIR, Differential-Fuzzing und v1.0-Konformitätsgates.

Sprachdesign, Speichersicherheit & Nebenläufigkeit

Speicher- & Nebenläufigkeitsspec
  • Null Lifetime-Annotationen Inferiertes Ownership mit geteiltem &T (inkl. $&T-Downgrade) und exklusivem $&T ohne 'a.
  • Symbolischer Fluss & Fehler << Return, >> Throw, <<< Exit, verpflichtendes >>> (err) {}; 0.15.0 gibt or frei.
  • Keine Funktionsfärbung & Generics Koroutinen ohne async/await-Färbung und monomorphisierte Generics ohne Parameterlimit.
  • Isoliertes unsafe Kein globaler veränderlicher Zustand, kein reflect, strikte Bounds/Div-Zero-Checks; *raw T nur in unsafe {}.
  • M:N-Scheduler & 16-KiB-Stacks Call-Graph-Stackanalyse ermöglicht 16-KiB-Mikrokoroutinen, M:N-Scheduling (Linux/macOS) und #sync/pool.
  • Channel-Optimierung & select 1:1-SPSC-Eliminierung, direktes Stack-Rendezvous, Fast-Path-Buffer-Channels und select.

192 Batterien-inklusive Stdlib-Module

API-Index öffnen
  • Span-Arena XUN & Formate Zero-Slice Span-Arena #encoding/xun (XUN v0.2.0-dev) sowie JSON, TOML, XML, CSV, ASN.1, PEM, Binary.
  • Asynchrone Netzprotokolle epoll/kqueue/WSAPoll, HTTP/1.1 & HTTP/2 Huffman, WebSocket, Pools, SMTP, APNS und SOCK_RAW.
  • TLS 1.3 & Kryptographie Reines Xu TLS 1.3/X25519/ACME, Hardware-AES/SHA-NI, SM2/3/4/9/ZUC/GMTLS (unzifiziert) und #crypto/subtle.
  • Kompression, Medien & Fonts Natives zstd, gzip, zlib, bzip2, tar/zip, PNG/JPEG/GIF und hostloses #ui/font TTF/OTF.
  • Tensoren, BigInt & Templates 47 #tensor-Primitive, #tile GEMM, #math/big, budgetiertes #regexp und #html/template.
  • OS-Pipes, SQL & Telemetrie Bidirektionale #os/exec-Pipes/Signale, TZif, #log/slog, #context, #rate, #database/sql und #testing.

Bare-Metal, Embedded MCUs & Zielplattformen

OS- & Bare-Metal-Doku
  • Freestanding & Kernel-Scaffold --profile=freestanding und xu init --baremetal erzeugen Minikernel (~1,9–2,4 KB ELF) samt QEMU-Skript.
  • 25 #core/*-Kernelsubsysteme Umfasst mmu, acpi, uefi, pci (BAR/MSI-X), fdt, virtio, net, disk, uart, backtrace.
  • Interrupts & Kontextwechsel @interrupt, @repr("C"), RAII-IrqSpinlock, Semaphore, 192B TaskContext und GICv3/PSCI/SBI.
  • MCUs & Funkprotokolle thumbv7em-none, riscv32imac-none, none-xtensa mit #embedded/{chips/esp32,bluetooth,wifi,display,mqtt} (Koexistenz experimentell).
  • Breite Cross-Compilation macOS, Linux (inkl. LoongArch64, RISC-V 64, ARM32), Windows und wasm32-wasi nativ integriert.
  • Desktop- & Mobile-Bundling macOS .app, Windows .exe, Linux ELF sowie xu build --phone für iOS/Android & SDL-GPU-Spielehost (#app).

AI-Inferenz, Multi-Backend-GPU & 50 Pakete

Paket-Matrix
  • Multithreaded Inferenz & VLM llm_engine unterstützt GGUF/SafeTensors, MLA/MoE/SSM, VLM mmproj.gguf, GBNF/Schema-Trie & Speculative Decoding.
  • Reines Xu Fine-Tuning & Serving LoRA-SFT (Checkpoints), DPO, GRPO, RLVR, Distillation sowie batched OpenAI/Anthropic/Ollama-HTTP-Serving.
  • Einheitlicher Multi-GPU-Stack gpu steuert llm_metal/metal (176 Symbole/FlashAttention), dlopen cuda_native und SPIR-V vulkan_native.
  • LLM-Gateways & Agent-Protokolle openai (11 Presets), anthropic, gemini, cohere, Failover-gateway, agent Swarm/StateGraph, mcp und a2a.
  • RAG, Guardrails & Evaluation rag (PgVectorPool/SQLite/Qdrant/GraphRAG), guardrails, eval (Ragas/Schema) und synth.
  • 30 Datenbank- & Infra-Treiber MySQL, Postgres, reines dlopen-SQLite, ClickHouse, MongoDB, Redis, Kafka, NATS, S3, gRPC, etcd, Prometheus.

FFI, Steuerprotokoll & Toolchain

CLI-Referenz
  • Bidirektionale C-FFI & Shared Libs xu native baut Multi-Target-.xulib, xu cbind erstellt C-Header-Assertions, --shared exportiert C-ABI-Bibliotheken.
  • Reproduzierbare Supply Chain xu.xun, MVS, sha256-tree-v1 xu.lock, vendor/, --frozen und Ed25519 XUSUMDB-Verifikation.
  • #xacp Steuerungskern Transportunabhängiger Sicherheits-/Framing-/UI-Aufnahmekern (xu xacp; native Laufzeitabnahme noch offen).
  • DWARF-Debug, Live-Docs & Flow Symbolische Backtraces & DWARF-Typen (0.15.0), xu debug, xu doc --serve und xu map Mermaid.
  • Natives xu-lsp & WASM Playground VS-Code/Cursor-Erweiterung (Completion, Diagnose, Rename, Quick-Fix) plus 75 Beispiele im Browser-Playground.
  • GUI-Setup & Atomare Updates Abhängigkeitsfreier nativer xu setup-Assistent, xu doctor und SHA-256-verifiziertes xu up.

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.

Open-Source-Ökosystem

Produktive Engines, Server und Pakete in reinem Xu

2D/3D-Spiel-Engine

Nexus Engine

Plattformübergreifende 2D/3D-Spiel-Engine in reinem Xu auf #gpu und #window: Szenenbaum, PBR & CSM/PCF-Schatten, 3D-Dreieckskollision & Starrkörperphysik, GLB/OBJ/STL-Import, Audiomixer und nativer Editor.

  • #gpu
  • PBR + CSM
  • 3D-Physik
  • Nativer Editor
Auf GitHub ansehen
Krypto-natives Agenten-Netzwerk

Fatext

API-first KI-Agenten-Plattform, E2EE-DM/Room-Relay, P2P-Signaling-Hub & Mail-Bridge ohne Datenbank oder Client-JS — als Einzelbinary in reinem Xu mit integriertem TLS 1.3 + ACME v2 Auto-TLS, SSR & SSE.

  • Einzelbinary
  • TLS 1.3 + ACME
  • E2EE-Relay
  • Ohne DB / JS
fatext.com besuchen
Offizielle Pakete · 50 Module

Official Packages

github.com/xulang-org/packages (v1.17.0) umfasst Datenbanken, Caches & Messaging sowie OpenAI/Anthropic/Gemini/Gateway, MCP/A2A/Agent/GraphRAG und Multi-Backend-GPU (gpu, llm_metal, cuda_native, vulkan_native).

  • gpu / llm_metal
  • cuda / vulkan
  • gateway / rag
  • agent / mcp / a2a
50 Pakete entdecken

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)
  • x64

Linux

  • arm64
  • x64
  • loongarch64
  • riscv64
  • arm32

Windows

  • x64 (PE AOT)
  • arm64

WebAssembly

  • wasm32 / WASI

Bare-Metal

  • x86_64
  • aarch64
  • riscv64 ELF

Xu mit einem Befehl installieren

Das Installationsskript erkennt Ihre CPU-Architektur automatisch, trägt PATH dauerhaft ein und liefert das vollständige SDK samt Standardbibliothek mit.

curl -fsSL https://xulang.org/install.sh | bash -s -- --online --version 0.16.0 --yes

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 102 groups with 121 workload variants on six ARM64 / x86-64 platforms, with measured runtime, memory, binary size, and source records.

Xu 0.16.0 erzwingt Modul-const am Dateianfang, liefert die Batches Q–T (Lock-free-MPMC-Kanäle, ARM64-30-FP-Regalloc, modularer M:N-Scheduler, SLP-Multi-Use-DAG-Vektorisierung, BCE), ergänzt #simd, #bytes/span, #gpu/video, #ffi/dl, #os/mmap, ESP32-C3 ELF32 --emit-obj und #core/{nvme,ahci,rtc,xhci} und besteht alle 121 Benchmarks auf sechs Plattformen (726/726, 0 Fehler).

Alle 28 häufig gestellten Fragen ansehen →