v2.0.0-devC11MIT licensed

A cross-platform C
infrastructure library
for the Internet + AI era

One coherent C11 stack connecting networking, concurrency, security, and data. From lightweight tools to network services — composable, controllable infrastructure for Internet and AI applications.

Single-header integration · Trim on demand · No third-party runtime dependencies

14
Domain extension libraries · designed with the kernel
2,512
Test source files · shipped with the repo
680
Example sources · learn from code
Built as one

A systematic capability set, calmer engineering choices

What's unified is more than a function prefix. Memory management, error propagation, asynchronous cooperation, and protocol handling form one coherent development experience.

01 / Compose

One foundation, the full stack

From data parsing and task scheduling to secure connections, the kernel and domain extensions reuse the same base capabilities — so your application can focus on the business.

Meet the layered architecture →
02 / Control

Take exactly what you need

Single header, modular sources, static or shared libraries — flexible to integrate. Module macros and dependency expansion keep feature combinations explicit and controllable.

Learn on-demand trimming →
03 / Efficiency

Performance designed in

Batched queues, memory reuse, platform-native network backends, and cryptographic hardware acceleration lay the groundwork for efficient data paths.

Explore performance design →
04 / Quality

Reliability written into the code

Structured error chains, strict protocol parsing, resource lifecycle management, and fault-injection testing together support maintainable systems.

Meet engineering quality →
Architecture

One kernel, eight focused extension libraries

The kernel carries infrastructure and protocol primitives; extension libraries face concrete application domains. Compose capabilities bottom-up, connected by one unified build system.

XRT Kernel C11

Cross-platform abstraction · Unified memory management · Structured error model

Protocols & Security
HTTP/1.1WebSocketTLS 1.2/1.3X.509
Networking & Concurrency
TCP / UDPCoroutinesChannelFuture / Task
System & Data
Files / ProcessesJSON / XLONJSONL / XLONLContainersText processing
Foundation
MemoryAtomicsError chainsTime / Logging

Consistent from architecture to delivery

Clear layered dependencies

Extensions build on kernel capabilities. Networking, protocols, and system abstractions keep being reused while domain capabilities evolve independently.

Composable capability boundaries

Module manifests describe sources and dependencies, feature macros control compilation scope, and trimming checks verify combination boundaries.

Integration that fits your project

Prototypes start from the self-contained single header; projects can choose modular sources or library artifacts — the same API throughout.

xhttp

HTTP applications

HTTP / HTTPS clients and servers. Connection pooling, caching, retries, authentication, and SSE to connect network services and streaming data.

Explore xhttp →

xws

Realtime connections

WebSocket client and server runtimes. Connection management, group broadcast, reference-based sending, and compression to build two-way communication.

Explore xws →

xruntime

Dynamic runtime

Dynamic types and an object system. Type registration, reference counting, object-graph reclamation, and dynamic invocation — a runtime foundation for host languages.

Explore xruntime →

xmail

Mail communication

MIME content and transport base; SMTP, POP3, and IMAP clients are provided by the xsmtp, xpop3, and ximap extensions.

Explore xmail →

xsmtp

Mail sending

SMTP client: protocol, STARTTLS/implicit TLS, authentication, and streamed submission derived from xmailmessage.

Explore xsmtp →

xpop3

Mail retrieval

POP3 client: protocol, STLS, authentication, and RETR/TOP bridges to the MIME tree.

Explore xpop3 →

ximap

Mail access

IMAP client: command layer, data views, streamed APPEND, and COMPRESS=DEFLATE.

Explore ximap →

xssh

Secure remote access

SSH2 protocol primitives and a client runtime. Key exchange, host identity verification, authentication, channels, and port forwarding to reach remote systems.

Explore xssh →

xacme

Certificates

ACME certificate issuance and management. Five cloud DNS providers, EAB, propagation confirmation, and one-call Obtain.

Explore xacme →

xjwt

Tokens

JWT/JWS signing and verification. HS/RS/ES families and JWKS key sets with kid-based selection.

Explore xjwt →

xoauth2

Authorization

OAuth2 client and OIDC application composition. Auth code, PKCE, token refresh and introspection.

Explore xoauth2 →

xllm

Model calls

Single model calls, streaming and provider adapters. OpenAI-compatible/Anthropic/Responses dialects, transport retry and usage stats.

Explore xllm →

xllm-session

Sessions

Session ledger, budgets, compaction and persistence. Context budgets, turn windows and JSONL archival.

Explore xllm-session →

xwork

Agent loop

Agent loop, tool execution and approval. Bounded tool loop, sub-agent delegation and the unified task system.

Explore xwork →
Internet + AI

Foundations for every layer of your application

Whether it's a client reaching a model service, a tool processing streaming events, or a concurrently-running network service — start composing from these capabilities.

CONNECT

Network connections & streaming

TCP, UDP, HTTP, TLS, and WebSocket working together. Handle streaming events through xhttp's SSE and build your service connection layer.

Make an HTTP request →
ORCHESTRATE

Concurrent tasks & coroutines

Threads for parallelism, coroutines to organize waiting; Channel passes work, Future composes results; task groups and cancellation tokens coordinate execution and wind-down.

Choose your concurrency model →
TRANSFORM

Structured data & text

JSON, XLON, dynamic values, containers, regex, and templates — one C data-processing foundation shared by configs, requests, responses, and structured content.

Browse the JSON API →
PROTECT

Secure connections & identity

TLS 1.2 / 1.3, X.509, cryptographic primitives, and platform randomness back encrypted communication; AES accelerated paths fit x86 and ARM capabilities.

Establish a TLS connection →
INTEGRATE

Local tools & system integration

Files, paths, processes, environment variables, and logging — cross-platform interfaces for tool execution, file handling, and system cooperation.

Browse the process API →
CONTROL

Resources & lifecycle

A unified allocator, memory pools, temporary arenas, and structured error chains carry resource ownership and error context through the application flow.

Understand the reliability design →
Engineering excellence

Excellence, grounded in every engineering path

Performance has samples, design has implementations, tests have entry points. Open the source and follow the same path to understand and verify XRT.

Performance sample / XRT 2
134.4M items/s

MPMC queue · batch 32

Benchmark archived 2026-07-28: Ryzen 5 5600, Windows, GCC 16.1; 4 producers / 4 consumers, median of 3 samples.

See test conditions & raw samples →
Engineering verification / source included
2,512 test source files

From happy paths to resource wind-down

Memory fault injection, zero-allocation paths, single-header builds, and protocol boundary tests cover engineering needs at every level.

Explore the test system →
Build with XRT

Let the next project start from solid ground.

Start from one C file and grow into the full capability system of networking, concurrency, and security.

Links