BigBrain LLC

BigBrain LLC · Free software, MIT licensed

The cheatah programming language

Cheatah is a small, Python-like programming language that compiles to native machine code — Python for people who care about performance. Pronounced “cheetah”, and misspelled on purpose: it feels like cheating — you write Python-like code and it runs like C++. You write .purr source files, compile them with purrc, and run them on the headless cheatah host. Because cheatah transpiles to modern C++ and is built at -O3 -march=native, a recursive fib(35) runs at parity with hand-written C++.

# hello.purr
import io

fn fib(n) {
    if n < 2 { return n }
    return fib(n - 1) + fib(n - 2)
}

io.print("fib(30) =", fib(30))
purrc hello.purr -o hello.so   # compile to a native module
cheatah hello.so               # run it

Read the cheatah documentation

Support cheatah

Cheatah is free, MIT-licensed software, and it stays that way. If it saves you time and you want to help fund its hosting, maintenance and future releases, you can donate an amount of your choosing to BigBrain LLC — an unconditional gift to the company that builds cheatah, taxable income to us and never tax-deductible for you; the full written terms are on the donation page.

♥ Donate to cheatah development

The name

Why is it spelled cheatah, not cheetah?

Because it feels like cheating: you write Python-like code and it runs at C++ speed — cheat + cheetah. The misspelling is deliberate, and it makes the name ours: search for cheatah and you find this language, not the animal.

Is this the Cheetah template engine for Python?

No. cheatah is unrelated to the CheetahTemplate/Cheetah3 templating project — it is a compiled programming language with its own compiler (purrc), runtime and standard library.

Why cheatah

Python-like, with a C-style struct vibe

Variables, full expressions and operators, if/else, while, for, functions and structs. Turing complete, and most Python scripts port over with light edits.

Compiled, not interpreted

A .purr file becomes a real .so loadable module. No interpreter, no VM, no boxing — the machine code is what the C++ compiler emits for equivalent code.

Native speed by construction

Internal-linkage functions inline freely, ints are 64-bit by default, strings are std::string, list and dict are std::vector and std::unordered_map. Hot numeric loops auto-vectorize to SIMD.

Memory-safe codegen

Generated code uses value types and STL containers — no raw new/delete, no manual pointer arithmetic. The sole exception is whatever you write inside a raw cpp escape hatch.

Headless and dependency-free

The language core and runtime have no external dependencies. The only third-party code is GoogleTest and Google Benchmark, used by the test suite alone.

Its own crypto and networking

A from-scratch TLS 1.3 client and server, Ed25519, X25519, P-256, ChaCha20-Poly1305 and AES-GCM — no OpenSSL anywhere in the stack. This page is served by it.

The standard library

Batteries included, all of it written from scratch. The full per-function reference documents every module:

ModuleWhat it gives you
io, os, sysPrinting, formatting and file I/O; environment, process and filesystem helpers plus a CSPRNG; command-line arguments.
string, datetime, timeText operations and Python's string constants; civil dates and formatting; monotonic and wall clocks.
math, statistics, randomAllocation-free scalar math; mean, median, variance and standard deviation; per-thread pseudo-random draws that never race.
ndarray, linalgN-dimensional arrays generic over the element type, with broadcasting and declarative SIMD; a numpy-style linear algebra suite — matmul, solve, inv, det, qr, svd, eig, norm.
regexFrom-scratch linear-time regular expressions on a lazy DFA — immune to ReDoS by construction.
parsersSIMD-accelerated JSON, a slab-DOM XML reader, URL and HTML parsers.
socket, requests, tls, websocketBSD sockets, a pure-cheatah HTTP client, a from-scratch TLS 1.3 stack, and an RFC 6455 WebSocket client.
hashlib, ed25519, x25519, p256, aeadSHA-256/512, HMAC, HKDF and Base64; public-key signatures; Diffie–Hellman; ECDSA; authenticated encryption. The primitives TLS is built on.
memory, threadOwnership for shared state via Owner and the request→acquire→lease flow, and real OS threads that share through it.

Get cheatah

Cheatah is free software under the MIT licence. The source, the compiler and the full test suite live on GitHub; the reference documentation is generated by cheatah's own documentation generator and served here.

What it is used for

Cheatah is not a side project: it is the language BigBrain LLC writes its own products in. The godspeed engine and its ash, alice, conjure and boltzmann extensions are built on it, as is the web server delivering this page. When the details are the product, you have to own the toolchain.

Status: alpha. Cheatah runs and is heavily tested — the QA gate runs the suite under AddressSanitizer, UndefinedBehaviorSanitizer and Valgrind at 100% coverage — but the language and its APIs may still change between releases. There is no sandbox: a .purr or .so is fully trusted by default, though modules can be signed and verified by the runtime. Read the security documentation before running code you did not write.