The Cajeta programming language
Familiar syntax.
Borrowed discipline.
Cajeta is a compiled systems language in the C++/Java family with
Rust-style ownership: explicit stack/heap
allocation, a static borrow checker, and no garbage collector — the
safety is settled at compile time, the runtime just runs. And it is
designed around AI agents from the ground up: the compiler is an MCP
server, and every library ships the guidance an agent needs to use it.
Cajeta compiles through LLVM — an optimizing, caching JIT for portable
archives, or ahead-of-time native binaries — pairing the ergonomics of
Java — classes, interfaces, packages, annotations — with the control of
C++ and the memory discipline of Rust. One owner per heap value,
borrows by default, ownership transfer with a single # operator, all
checked before the program ever runs. It specializes where predictable
performance and safety have to coexist: services and CLIs, embedded targets,
and — through a first-class compute path — GPU kernels written in the same
language as the host program.
Safe without a GC
Compile-time borrow checking, deterministic drops, no pauses. Use-after-move is a compiler error, not a crash report.
Syntax you already know
If you read Java or C++, you read Cajeta. Classes, generics-style templates (monomorphized), operator overloading, annotations.
GPU as a language feature
Kernels, cooperative matrices, and device buffers are part of the language and stdlib — not a bolted-on toolkit.
Batteries included
Collections, streams, fibers and channels, JSON/CSV codecs, networking, reflection — a coherent stdlib, one doc per class.
Built for agents
Most Cajeta from here on will be written with an agent in the loop. What limits an agent on an unfamiliar language is not reasoning — it is access to authoritative, specific guidance at the moment it writes the line. So Cajeta ships that guidance in the toolchain, next to the code it describes, served over a protocol the agent already speaks.
The compiler is an MCP server
cajeta compiler-mcp speaks Model Context Protocol over stdio — no second binary, no daemon, no network. It exposes searchSkills, listSkills, and getSkills, and its initialize instructions tell the agent to look guidance up before it writes code.
Skills, not scraped docs
Hand-written guides keyed to a library, package, class, or method — written against the failure modes that make a Java-fluent model crash, not as a second API reference. More than 180 ship embedded in the compiler, covering the language, the toolchain, and every stdlib package.
Every library ships its skills
Skills are part of the .cja archive format: put them in skills/*.md and the build validates, indexes, and packages them beside the bitcode. Resolve a dependency and you have its guidance — offline, pinned to the version you resolved.
Search that survives a typo
Matching is fuzzy and hierarchical: a misspelled name still resolves, and one query returns the symbol, its neighbours, and the overview above it. Every result is a stable cja-skill:// URI — a valid cache key, identical on every machine.
The same three operations are available to humans and CI as
cajeta search-skill / list-skills / get-skills, from the same in-process
cores. See the built-in MCP server and
the skill system.
From IR to silicon
Cajeta is built on LLVM: source lowers to LLVM’s intermediate representation (IR), is optimized — including auto-vectorization onto the host’s SIMD registers — and is converted directly into machine code for the processors that will execute it.
Write once, run anywhere
Executables and libraries ship as IR in compressed .cja archives. The optimized JIT lowers them for whatever CPU they land on and caches the machine code — warm starts skip compilation entirely, so execution is fast from the first call.
Native binaries
The same IR compiles ahead of time into a conventional executable for a specific target — for deployments that want to forego the JIT machinery altogether.
Every GPU, one source
Kernels lower through LLVM directly to GPU architectures — NVIDIA PTX, AMD GCN, and SPIR-V for the Vulkan-portable path. Pin a device target explicitly, or let the toolchain select the best execution profile for the silicon it finds, falling back — ultimately to the CPU path — so kernel code always runs.
Lazy linking
The runtime and standard library link as bitcode, and only what your program references is materialized into the output — keeping binaries and JIT working sets small.
The toolchain
cajeta — the builder
One binary for the whole loop: project init, dependency resolution, build, test, lint, docs, packaging, publish. Tasks live in cajeta.json; there is no fixed lifecycle to fight.
cvm — version management
Installs and switches toolchains the way rustup does for Rust: cvm install latest, cvm default, cvm doctor. Toolchains live under ~/.cajeta/versions.
IDE plugins
A JetBrains/IntelliJ IDEA plugin with build tooling built in — IDE support is IntelliJ-family today, with VS Code next — plus Language Server and Debug Adapter protocols so any LSP/DAP-capable editor gets completion and breakpoints.
Olla — the public repository
The package registry for Cajeta libraries — a growing set spanning machine learning, network analysis, gradient boosting, HTTP, and logging: signed publishes, content-addressed artifacts, transparent logs. Browse and publish at olla.cajeta.dev.
Platform-independent libraries
Three library families make Cajeta a working platform for numerical and visual computing — written once, running across vendors and devices.
Nucleo data science & ML
The consolidated core for porting the Python scientific stack: tensors and Arrow-native dataframes over one buffer model, lazy expression fusion, autograd, and numpy/scipy/torch-style surfaces — with kernel-level matrix and tensor math spanning SIMD CPU and GPU.
XPU compute
Portable device compute: kernels, pipelined GEMM primitives, cooperative matrices, and device profiles that target NVIDIA, AMD, and Vulkan-class hardware from one source.
GFX graphics
Graphics primitives built on XPU — streaming geometry, ray queries, samplers — for visualization and rendering without committing to a vendor API.
Where to go next
- New to Cajeta? Start with the guide — a linear walk from installation to reflection, in 22 short chapters.
- Looking up an API? The stdlib reference has one document per public class.
- Wiring up an agent? CompilerMcp has the server and its tools; Skills covers the format, the authoring levels, and how to ship skills with your own library.
- Designing against the language? The language specification holds the deep-dive documents behind every subsystem.
- Wondering about speed? The benchmarks compare Cajeta against incumbent runtimes on shared workloads.