CX+AI Try it ›
Powered by CX+AI — how this site is built
Buy me a coffee If you wish to help
Get CX+AI ›
A programming language · a game engine · a local AI runtime

AI as a component. Not an oracle.

CX+AI treats a local small language model as a deterministic, observable component of a running program — not a remote service you rent by the token. Write one line; an entity in your game or application behaves autonomously. Then ask the toolchain to show you — in source code — exactly what its AI wrote.

Get CX+AI ›
  1. Download the folder for your platform
  2. Run its installer: sh ./install.sh — on Windows, install.ps1
  3. Write a file and run it: cx hello.cx --run

Free to use, including commercially — the licence, and what we claim and what we don’t.

you writeguard.cx
the toolchain shows its workcx --decompile
// AI-authored rule on 'guard' — decompiled from the register VM
{
    float d = distance(e["x"], e["y"], player["x"], player["y"]);
    if (d < 120) { e["state"] = "pursue"; }
    else { e["state"] = "patrol"; }
}

That second panel is the point. AI-written behaviour runs in a bounded region executed by a compact register VM — and the bytecode it produced decompiles back to readable source with cx --decompile, whenever you want to audit what your program was told to do.

01 / explore

Six doors. Open any of them.

Click a card — it leaves the grid and expands. Esc or the backdrop sends it home.

01 / language

What CX+AI is

C, expanded. The same power, far less ceremony.

click to open

CX+AI compiles to C. Strings, lists, maps and json are first-class values — no malloc, no length bookkeeping, no free — and every escape hatch of C stays reachable, including literal C through _C{}. The source stays flat; nothing is taken away to get there.

Two recent examples of what that principle buys. A handle answers questions about itself in one spelling — doc->count, doc["servers"]->type — which cost nothing at run time and made a whole family of footguns unwritable rather than merely fixed. And a json document or a rule body can now be written as itself, in braces, and is parsed at build time: a typo is an error on that source line instead of a surprise while the program is running.

02 / ai

Behaviour written while it runs

A rule is a string. A model can write it.

click to open

A CX+AI rule is a short C body over an entity, and it is data — a string the program can swap while it runs, from a config file or from a model, with no recompile. aiRule(entity, schedule, trigger, prompt) turns a sentence of English into behaviour that runs on its own schedule.

CX+AI compiles that rule in-process, through its own assembler, to register-VM bytecode. There is no system(), no popen, no dlopen anywhere on that path — which is why it works in places that have no toolchain installed at all.

It is not a slow path. A two-phase rule bakes an authored catalogue into typed slots once, then reads baked numbers per event: measured on a stock-control workload with honest string-key lookup in the hot loop, that runs within about 1.3× of hand-written native C — roughly five million events a second on the VM.

03 / playground

Write CX+AI, press Run

Curated examples, or your own program.

click to open

The register VM compiled to WebAssembly, running in your own tab. The server compiles and stops there — it never executes what you wrote. Your program runs on your machine, and if you write an infinite loop the only thing you can hang is your own worker thread, which the page kills for you.

Examples come levelled simple, medium and advanced, including the one that matters most: a rule written as a string while the program is running, compiled on the spot, changing a live entity.

Open the playground
04 / download

Windows, Linux, macOS

Installable today, free to use.

click to open

Each platform gets a complete drop-in folder: the cx binary, a prebuilt runtime library, public headers, and a one-command installer that proves itself with a real build before it claims success. Windows is self-contained with graphics on; Linux and macOS use the platform's own system libraries, from a list measured on the real link rather than guessed.

Free to use, including commercially, with credit to CX+AI for bundled material. It is not open source: you get binaries, headers and examples — the compiler and runtime source stay private.

Get CX+AI
05 / docs

Manuals that check themselves

Generated from the source that implements them.

click to open

Eight reference manuals ship with the release, and each one is generated from a checked source: a manual that names a builtin which does not exist is refused publication rather than quietly shipped.

The builtins reference is the one to start with. It counts itself, and it states its own coverage rather than implying completeness: every one of the 882 builtins the compiler accepts has a row, across 35 families, and 882 of those rows carry a description verified against the C source. A manual that tells you what it has not covered is worth more than one that doesn't.

Read the manuals Builtins reference
06 / gigantica

What comes next

The demo being built to push CX+AI under load.

click to open

Gigantica is the showcase — a 3D game with a particle system, world-space effects and AI-driven entities, built in CX+AI to find out what the engine does when it is genuinely worked. It ships alongside the release.

There is no launch date on this page and no demo promise. CX+AI itself is downloadable today; Gigantica is the thing to follow.

Follow the build
02 / the platform

A complete stack, written in pure C.

882
documented built-in functions
across 35 families
10
AI providers supported
including fully local
300+
automated tests passing
Windows, Linux and macOS
1000+
testers via the Kwaai community
personal, local, open AI

Compiler, IDE, 2D/3D game engine with a particle system, and an embedded AI subsystem — one codebase, native ahead-of-time compilation for your code and a compact register VM for the AI's. Windows, Linux and macOS, native and VM, with identical output. CX+AI is C-compatible: everything C can do, CX+AI can do, with less ceremony.

We are members of the Kwaai community and share its conviction that AI should be personal, local and open to inspection.

What you get

Nine of them. Click any card to open it.

01 / language

A language, not a framework

C-compatible, compiled ahead of time.

click to open

CX+AI compiles to C and links as a native binary. Strings, lists, maps and json are first-class values, so there is no malloc, no length bookkeeping and no free to get wrong — and every escape hatch of C stays reachable, including literal C in a _C{} block.

Nothing is taken away to make it easier. That is the whole design constraint.

json doc;
doc["servers"][0]["host"] = "alpha";  // levels made on demand
print(doc->count);                     // prints 1 — the handle knows itself
02 / ai

AI as a component

One line, and an entity behaves on its own.

click to open

An aiRule attaches a model to an entity with a schedule and a trigger. The model has a defined place in the run loop — it is a component, not a service call bolted to the side of your architecture.

Ten providers are supported, including fully local ones, so a program can ship with no external dependency and no per-token cost.

// guard is an entity; 0 = every frame, "" = no extra trigger
aiRule(guard, 0, "",
       "pursue the player when within 120 units; otherwise patrol");
03 / audit

Auditable by design

Read back what the AI actually wrote.

click to open

AI-authored behaviour compiles to bytecode for a compact register VM and runs inside a bounded region. cx --decompile turns that bytecode back into readable source.

So what is my program being told to do? is a question with an answer you can read, at any time, rather than a matter of trust.

04 / execution

Two modes, one language

Native AOT for your code, VM for the AI's.

click to open

Your code is compiled ahead of time to native machine code through C. The AI's regions run in the register VM, because they must stay inspectable and replaceable while the program is running.

Same language, same source, same results. The split is about who wrote the code, not about what it can do.

05 / platforms

The same answer everywhere

Windows, Linux, macOS — native and VM.

click to open

All three platforms are built and tested, and the native and VM paths are held to identical output rather than merely "both working".

Over 300 automated tests run against that promise. A divergence between two backends is a failure, not a footnote.

06 / engine

A 2D and 3D engine

With a particle system, in the box.

click to open

The gpu_* API covers 2D and 3D rendering with world-space particles.

Both GPU and CPU are supported natively. Drawing runs on the graphics card, but the image pipeline has a separate pure-CPU path that needs no window at all — so images can be loaded, treated and inspected headlessly, at build or design time, and only uploaded as textures when something is actually drawn.

Images can be tagged with a treatment class and the loader applies its recipe on load — alpha synthesis, edge cleanup, filtering — so the handling a sprite needs is stated once as data instead of repeated at every call site.

// pure CPU: no window, no graphics card needed
gpu_image_load_as("hero.png", "sprite_clean");
07 / stdlib

Batteries actually included

Networking, archives, JSON, rules.

click to open

HTTP, FTP, SFTP, SSH and email; compression and archives; a rules and automation engine; and JSON with auto-vivification, so building a nested document does not mean creating each level by hand first.

These ship with the compiler rather than arriving as a package manifest.

sBody.s = httpGet("https://example.com/status.json");
json j = jsonParse(sBody);
print(j["state"]);
targz("backup.tar.gz", "./data");

The 35 component families, with the number of described builtins in each. These are the reference's own counts.

json77
containers70
3D graphics69
strings60
AI core48
game helpers46
window & input46
images & textures42
cxGrid39
math39
debugging & assertions34
AI bytecode & codeswap30
xml30
date & time25
rules & events24
network21
queues19
2D drawing & effects18
files & filesystem18
system info17
memory files15
compression & archives11
http11
particles11
vm11
process control10
sorting & search10
GUI7
hashing5
assets4
eval4
regular expressions4
error handling3
color2
random2

35 families · 882 described builtins — the counts above add up to exactly the number on the tile.

Browse them all
08 / docs

Manuals that refuse to lie

Generated from the code they document.

click to open

Eight reference manuals are generated from checked sources. A manual that names a builtin which does not exist is refused publication rather than quietly shipped.

The builtins reference states its own coverage — 882 of its 882 rows carry a verified description — instead of implying it covers everything.

Read the manuals Builtins reference
09 / playground

Run it without installing

Write CX+AI in the browser and press Run.

click to open

There is nothing to download and nothing to set up. Open the playground, type a program, press Run, and the answer appears — on your own machine, in the page you are already looking at.

Your program never runs on our computers. We only turn it into something your browser can run, and your browser does the rest. It is a good way to find out whether you like the language before installing anything.

print("hello from a browser tab");
n.i = 0;
for (i.i = 1; i <= 10; i = i + 1) { n = n + i; }
printf("1..10 sums to %d\n", n);
For the experts

The server runs cx --emit-risc and returns bytecode for the compact register VM; that VM, compiled to wasm32, executes it in a Worker in your tab. The sandbox boundary is stated rather than faked — system() stops with CX-E5037 naming the capability instead of inventing a return value, and _C{} blocks stop with CX-E5003 because literal C needs a native binary. File and ai* builtins are refused at compile time, which is the same answer a native cx --runvm gives.

Try it in your browser
10 / languages

It speaks your language

Five, and not just in the compiler.

click to open

Compiler messages come in English, Spanish, French, German and Italian. Pick one, or let it follow the language the computer is already set to.

It does not stop at the compiler. The choice is built into the program you produce, so a CX+AI application you ship reports its own errors in your user's language — without you writing a single translation.

// one broken line, compiled five times
EN  error: CX-E0001: expected ')', got EOF
ES  error: CX-E0001: se esperaba ')', se obtuvo EOF
FR  error: CX-E0001: attendu ')', obtenu EOF
DE  error: CX-E0001: ')' erwartet, EOF erhalten
IT  error: CX-E0001: atteso ')', ottenuto EOF

The code is the same in every one. Translate the sentence, never the identifier — so a search for CX-E0001 finds the same answer whichever language it was read in.

For the experts

One catalog serves both the compiler's diagnostics and the compiled program's runtime errors: one row per message, one column per language, English at index 0 and the fallback for any untranslated cell. Select with #pragma cxlanguage IT or -P cxlanguage=auto, which detects the locale through portable getenv rather than a platform API. emit_c bakes the choice into the generated main(). Adding a language is one enum value and one column.

03 / team

Built by people who build runtimes.

Terence Agius

Founder · Technology

Thirty-five years building runtime and VM systems. Sole technical author of the CX+AI platform — compiler, engine, and AI subsystem.

Walter Lundari

Co-founder · Commercial

Marketing, partnerships and European regulatory engagement. A degree in AI and telecommunications, with a career spanning industry and academia — he ran a web design and e-commerce business in Milan for many years, and now works as a consulting lecturer.

04 / follow the build

Follow the build.

CX+AI is already downloadable for Windows, Linux and macOS. What comes next is Gigantica — the ambitious demo we're building to show what CX+AI actually does under load. Leave an email and we'll send you its progress. Nothing else; no newsletter carpet-bombing.

Form not working? Email us directly: hello@cxai.plus

Or just watch: every arc dispatched and shipped, updated as it happens.

CX+AI doesn't reinvent the wheel. It is the wheel.

CX+AI is built by one person. Using it and saying what happened — what worked, what broke, what was missing — is the most useful thing anyone else can do.

Ways to help →