XU XU
XU

Código de sistemas seguro en memoria.Sin recolector de basura.

Xu verifica la propiedad y los préstamos en tiempo de compilación y compila de forma anticipada a código máquina nativo y WebAssembly. Liberación determinista, canales tipados y corrutinas M:N — todo desde un único comando xu.

@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

Carga de arranque medida en macOS ARM64 (Apple Silicon): binario nativo de 81.0 KiB · 7.8 ms de tiempo mediano de ejecución

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

Medido, no afirmado

Evaluado frente a C, Rust, Go y Swift

Media geométrica del tiempo mediano de ejecución de Xu dividido entre el de cada lenguaje par, en 121 cargas de trabajo en macOS ARM64 (Apple Silicon), medido el 2026-11-29. Por debajo de 1.00× significa que Xu terminó más rápido.

Relación de tiempo de ejecución (media geométrica)

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

Rango de tamaño de binario nativo (KiB)

Xu 81–1468
C 16–49
Rust 456–585
Swift 33–77
Go 1789–8041
Abrir el panel completo de benchmarks →

Capacidades de sistemas full-stack: del kernel bare-metal y MCU a la IA local y apps nativas

Un único lenguaje y CLI xu unificada para compilación AOT propia, seguridad Zero-GC, concurrencia M:N, pilas inalámbricas, IA pura en Xu, UI nativa, móvil e interoperabilidad C.

Toolchain bare-metal publicado

Sistemas operativos y kernels

Construye kernels autónomos y firmware UEFI con --profile=freestanding y xu init --baremetal: 25 módulos #core/*, MMU, VirtIO, GICv3 / PSCI / SBI, @interrupt, @repr("C") y MMIO unsafe aislado.

  • x64-none
  • arm64-none
  • riscv64-none
  • x64-uefi
  • arm64-uefi
Guía de desarrollo de kernels
Pila de IA de 4 capas en Xu puro

I+D en IA, inferencia local y ajuste fino

47 primitivas #tensor y fusión SIMD K-quant --tensor-fusion para llm_engine (--threads N, VLM, GBNF/Schema, LoRA/RLVR), llm_metal / cuda_native / vulkan_native y MCP/A2A/GraphRAG.

  • GGUF
  • Safetensors
  • #tensor
  • Metal / CUDA / Vulkan
Guía de IA e inferencia

AOT nativo propio, MIR tipado y WebAssembly

Sin LLVM ni compilador C externo. Compila en auto-alojamiento 6 destinos principales más LoongArch64, RISC-V, wasm32-wasi y bare-metal con lotes MIR A–T, SLP, --pgo y endurecimiento Mach-O/ELF/PE.

$ xu build app.xu --pgo app.pgo $ xu build app.xu --target wasm32-wasi -o app.wasm Objetivos y estado

Propiedad sin lifetimes manuales y RAII Zero-GC

Propiedad única y préstamos compartidos (&T) o exclusivos ($&T) inferidos sin anotaciones 'a. Liberación determinista sin pausas de GC; *raw T y volatile aislados en unsafe.

fn push(buf $&[]int, v int) fn sum(buf &[]int) int Modelo de seguridad de memoria

Flujo simbólico y cero coloración de funciones

Inmutable por defecto, sin punto y coma ni paréntesis redundantes; << retorno, >> error y >>> captura/propagación sin Result/? ni async/await.

Manejo de errores y sintaxis

Corrutinas M:N, pilas de 16 KiB y canales tipados

Lanza corrutinas de 16 KiB con xu f(), planificador M:N por defecto en Linux/macOS, #sync/pool, eliminación estática SPSC y select.

Modelo de concurrencia

MCUs embebidos, ESP32 y pilas inalámbricas

Destinos thumbv7em-none, riscv32imac-none y none-xtensa con #embedded/{chips/esp32,bluetooth,wifi,display,mqtt} (coexistencia Wi-Fi/BLE experimental).

API embebido y MCU

Red asíncrona, TLS 1.3 puro Xu y criptografía

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

Red y criptografía

GPU multiplataforma, ventanas, UI y WebView

#gpu, #window y #ui/* integran pases GPU headless, layout retenido, 46 widgets con tema (:focus-visible), 30 gráficos nativos y WebView2/WebKit.

Guía GPU y UI desktop

Apps móviles iOS / Android y host de juegos GPU

xu build --phone genera proyectos ARM64 iOS y Android con zonas seguras, IME, háptica y perfil --phone-profile game con recursos #app.

Desarrollo móvil

Módulos, XUN Arena, SQL y 50 paquetes

Compilaciones reproducibles con xu.xun/xu.lock/--frozen + XUSUMDB Ed25519; #encoding/xun Span-Arena, #database/sql, SQLite dlopen y 50 paquetes.

Explorar 50 paquetes

FFI C bidireccional, .xulib y núcleo #xacp

Empaqueta archivos C en .xulib con xu native, cabeceras con xu cbind, bibliotecas --shared y núcleo #xacp (sesiones nativas pendientes de verificación).

Módulos nativos y FFI

CLI unificada, depuración DWARF, LSP y docs

Un solo binario xu para compilar, probar, debug (LLDB/GDB y tipos DWARF), backtraces simbólicos, doc --serve, map Mermaid, xu-lsp e instalador GUI.

Referencia CLI

Atlas completo de capacidades técnicas

Explora Xu 0.16.0 por seis áreas de ingeniería: compilador, lenguaje y concurrencia, 192 módulos stdlib, bare-metal/MCU, IA/GPU y toolchain.

Backend del compilador y pipeline de optimización

Destinos y estado
  • Auto-alojamiento de punto fijo Sin LLVM ni compilador C; las 6 plataformas Tier-1 superan la verificación de punto fijo.
  • Lotes MIR tipados A–T Refinamiento de alias IPA ModRef, inlining cold/.okp, eliminación de límites BCE y multi-push reserve.
  • Vectorización SIMD y tiling Vectorización SLP, tiling GEMM MEMOIR y SROA con fusión tensorial hacia ARM64 NEON/SDOT y x64 SSE2/SSSE3.
  • PGO y codegen de bajo nivel Distribución Ext-TSP con --pgo, reutilización LFTR/NZCV en ARM64 y cmov/MULH/atómicas x64.
  • Endurecimiento binario nativo Mach-O LC_CODE_SIGNATURE y __DATA_CONST, ELF W^X/PIE/Full RELRO/CET, PE32+ W^X y .pdata.
  • Verificación y conformidad Comprobador XU_VERIFY_MIR=1, volcado XU_DUMP_MIR, fuzzing diferencial y compuertas v1.0.

Diseño del lenguaje, memoria y concurrencia

Memoria y concurrencia
  • Cero anotaciones de lifetime Propiedad única y préstamos &T / $&T inferidos automáticamente sin anotaciones 'a.
  • Flujo simbólico y errores << return, >> throw, <<< salida, >>> (err) {} obligatorio; 0.15.0 libera or.
  • Sin coloración ni límites genéricos Corrutinas sin coloración async/await y genéricos monomorfizados sin tope de parámetros.
  • Frontera unsafe aislada Sin estado global mutable ni reflect, chequeos estrictos; *raw T y volatile solo en unsafe {}.
  • Planificador M:N y pilas de 16 KiB Análisis de pila acotada para microcorrutinas de 16 KiB, M:N en Linux/macOS y #sync/pool.
  • Canales y rendezvous cero copia Eliminación estática SPSC 1:1, transferencia directa pila a pila, canales con búfer rápidos y select.

Biblioteca estándar integral (192 paquetes)

Ver índice API
  • XUN Span-Arena y formatos #encoding/xun zero-slice (XUN v0.2.0-dev), JSON, TOML, XML, CSV, ASN.1, PEM y binario.
  • Protocolos de red asíncronos epoll/kqueue/WSAPoll, HTTP/1.1 y HTTP/2 Huffman, WebSocket, pools, SMTP, APNS y SOCK_RAW.
  • TLS 1.3 y criptografía TLS 1.3/X25519/ACME en Xu puro, AES/SHA-NI, SM2/3/4/9/ZUC/GMTLS (sin certificación) y #crypto/subtle.
  • Compresión, imagen y fuentes zstd, gzip, zlib, bzip2, tar/zip, PNG/JPEG/GIF y fuentes TTF/OTF #ui/font sin host.
  • Tensores, matemáticas y plantillas 47 primitivas #tensor, #tile GEMM, #math/big, #regexp con presupuesto y #html/template.
  • Tuberías OS, SQL y observabilidad Pipes bidireccionales #os/exec, TZif, #log/slog, #context, #rate, #database/sql y #testing.

Bare-metal, MCUs embebidos y destinos

Docs OS y bare-metal
  • Modo freestanding y plantilla --profile=freestanding y xu init --baremetal crean un kernel mínimo (~1,9–2,4 KB ELF) + QEMU.
  • 25 subsistemas de kernel #core/* Incluye mmu, acpi, uefi, pci (BAR/MSI-X), fdt, virtio, net, disk, uart y backtrace.
  • Interrupciones y cambio de contexto @interrupt, @repr("C"), IrqSpinlock RAII, Semaphore, TaskContext 192B y GICv3/PSCI/SBI.
  • MCUs y pilas inalámbricas thumbv7em-none, riscv32imac-none y none-xtensa con #embedded/{chips/esp32,bluetooth,wifi,display,mqtt} (experimental).
  • Compilación cruzada amplia macOS, Linux (LoongArch64, RISC-V 64, ARM32), Windows y wasm32-wasi integrados.
  • Empaquetado desktop y móvil Bundles macOS .app, Windows .exe, Linux ELF, proyectos iOS/Android (--phone) y host SDL GPU (#app).

Inferencia IA, multi-GPU y 50 paquetes

Matriz de paquetes
  • Inferencia multihilo y VLM llm_engine ejecuta GGUF/SafeTensors, MLA/MoE/SSM, VLM mmproj.gguf, GBNF/Schema Trie y decodificación especulativa.
  • Ajuste fino en Xu puro y servidor LoRA SFT (checkpoints), DPO, GRPO, RLVR, destilación y servidor continuo OpenAI/Anthropic/Ollama.
  • Pila GPU multibackend unificada gpu unifica llm_metal/metal (176 símbolos/FlashAttention), cuda_native (dlopen) y SPIR-V vulkan_native.
  • Gateways LLM y protocolos Agent openai (11 presets), anthropic, gemini, cohere, gateway, agent Swarm/StateGraph, mcp y a2a.
  • RAG, guardarraíles y evaluación rag (PgVectorPool/SQLite/Qdrant/GraphRAG), guardrails, eval (Ragas/Schema) y synth.
  • 30 drivers de BD e infraestructura MySQL, Postgres, SQLite dlopen puro Xu, ClickHouse, MongoDB, Redis, Kafka, NATS, S3, gRPC, etcd, Prometheus.

FFI, protocolo XACP y toolchain completa

Referencia CLI
  • FFI C bidireccional y libs compartidas xu native empaqueta .xulib, xu cbind genera cabeceras C y --shared exporta bibliotecas dinámicas.
  • Cadena de suministro reproducible xu.xun, MVS, xu.lock sha256-tree-v1, vendor/, --frozen y verificación Ed25519 XUSUMDB.
  • Núcleo de control #xacp Tramas XACP/1, permisos y muestreo UI acotado vía xu xacp (sesiones nativas pendientes de verificación).
  • Depuración DWARF, docs y diagramas Backtraces simbólicos y tipos DWARF (0.15.0), xu debug, xu doc --serve y diagramas Mermaid xu map.
  • xu-lsp nativo y Playground WASM Extensión VS Code/Cursor completa (autocompletado, diagnósticos, renombrado) y 75 ejemplos ejecutables en WASM.
  • Instalador GUI y actualización atómica Asistente gráfico nativo xu setup sin dependencias, xu doctor y actualización xu up verificada con SHA-256.

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.

Ecosistema de código abierto

Motores, servidores y bibliotecas creados en Xu puro

Motor de juegos 2D/3D

Nexus Engine

Motor 2D/3D en Xu puro sobre #gpu y #window: grafo de escena, materiales PBR y sombras CSM/PCF, colisión 3D por triángulos y cuerpos rígidos, importación GLB/OBJ/STL, audio y editor nativo.

  • #gpu
  • PBR + CSM
  • Física 3D
  • Editor nativo
Ver en GitHub
Red cifrada para agentes

Fatext

Plaza social API-first para agentes de IA, retransmisión E2EE DM/Room, hub de sinalización P2P y puente de correo sin base de datos ni JS — servidor de binario único en Xu con TLS 1.3 + ACME v2 Auto-TLS, SSR y SSE.

  • Binario único
  • TLS 1.3 + ACME
  • Relé E2EE
  • Sin BD ni JS
Visitar fatext.com
Paquetes oficiales · 50 módulos

Official Packages

github.com/xulang-org/packages (v1.17.0) reúne bases de datos, cachés y mensagería junto a OpenAI/Anthropic/Gemini/Gateway, MCP/A2A/Agent/GraphRAG y cómputo GPU (gpu, llm_metal, cuda_native, vulkan_native).

  • gpu / llm_metal
  • cuda / vulkan
  • gateway / rag
  • agent / mcp / a2a
Explorar 50 paquetes

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

Instala Xu con un solo comando

El instalador detecta la arquitectura de tu CPU, registra PATH e incluye el SDK completo y la biblioteca estándar.

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 exige colocar const al inicio del archivo, incorpora los lotes Q–T (canales MPMC sin bloqueos, 30 FP ARM64, planificador M:N modular, vectorización SLP DAG y BCE), añade #simd, #bytes/span, #gpu/video, #ffi/dl, #os/mmap, ELF32 --emit-obj para ESP32-C3 y #core/{nvme,ahci,rtc,xhci}, y supera los 121 benchmarks en seis plataformas (726/726, 0 fallos).

Ver las 28 preguntas frecuentes →