Skip to main content

transpilatron

Write Python. Get a native C binary. No C knowledge required.

uvx transpilatron your_code.py

Benchmarks

Benchmark Python C Speedup
Sieve of Eratosthenes (10M numbers) 0.526s 0.022s 24x
Selection sort (10K elements) 1.963s 0.033s 58x

Verified on the same machine. Same output. Fully static binaries.

Benchmarker's PC:
CPU: Ryzen 5 5500
Python 3.14
Zorin OS 18

Demo: Flask app → C web server

This Flask app:

from flask import Flask

app = Flask(__name__)

@app.route('/')
def hello():
    return 'Hello from the webserver!'

@app.route('/ping')
def ping():
    return 'pong'

if __name__ == '__main__':
    app.run(host='0.0.0.0', port=8080)

Becomes a native C HTTP server with one command:

uvx transpilatron web.py
$ ./out/web &
Server running on http://0.0.0.0:8080

$ curl http://localhost:8080/
Hello from the webserver!

$ curl http://localhost:8080/ping
pong

No Flask. No Python runtime. No dependencies. Verified memory-safe by valgrind (0 errors, 0 leaks).

Demo: It transpiles itself

transpilatron is written in Python. So we transpiled it.

uvx transpilatron src/transpilatron/agent.py

The result is a fully working C binary that does exactly what the Python version does — reads your entry file, invokes the AI agent, and produces a C binary. Verified valgrind-clean.

$ ./out/agent --help
Usage: ./agent [--minimal|--full] <entry_file>
  --minimal  Use minimal mode: static linking, raw sockets only
  --full     Use full mode (default): dynamic linking, libcurl, etc.

$ ./out/agent examples/web.py
Thinking...
I'll help you convert the Python project to C...

A C binary, orchestrating an AI agent, transpiling Python to C.

How it works

transpilatron uses an AI agent to convert your Python project into C, compiles it (using -O2 or -O3 flags), and hands you a native binary. No runtime, no interpreter, no dependencies.

  1. Reads your Python entry file and follows all imports
  2. Transpiles the full project to C
  3. Writes a Makefile and compiles (static for --minimal, dynamic for --full)
  4. Automatically installs any missing build tools via your system package manager (with sudo)
  5. Runs the binary under valgrind to verify zero memory leaks and zero segfaults
  6. Audits the generated C for race conditions, NULL dereferences, and logic bugs
  7. Drops the verified binary in out/

Requirements

Tool Why
uv Run transpilatron instantly with uvx

That's it. The AI agent automatically detects, installs, and configures all other dependencies (C compilers, make, valgrind, system headers, and the Poolside CLI itself) on first run.

Install

# Run without installing
uvx transpilatron your_code.py

# Or install globally
uv tool install transpilatron

On first run, the tool bootstraps all its dependencies and asks you to authenticate with Poolside (free).

Usage

# Default (full mode) — dynamic linking, libcurl, torch/tflite, web frameworks
uvx transpilatron your_code.py

# Minimal mode — fully static, raw sockets, initramfs-safe
uvx transpilatron --minimal your_code.py

The binary lands at out/<your_code>. That's it.

Modes

Mode Default Linking HTTP torch/tensorflow Web Frameworks Best for
--minimal Static only Raw BSD sockets Aborts with error Not supported initramfs, scratch containers, embedded, zero-dependency binaries
--full Dynamic permitted libcurl libtorch / TFLite C API libmicrohttpd General use, speed + versatility, web apps

What it handles

  • Pure Python logic → idiomatic C
  • HTTP (requests, urllib3) → raw BSD sockets (--minimal) or libcurl (--full)
  • JSON → cJSON
  • Threading → pthreads
  • File I/O → POSIX syscalls
  • Multi-file projects → one binary
  • Web frameworks (flask, fastapi, django) → libmicrohttpd (--full only)
  • torch / tensorflow → libtorch / TFLite C API (--full only)
  • Detects and fixes common Python bugs during transpilation
  • Memory-safe output verified by valgrind on every build

Quality & Safety

Every build goes through an automatic quality pipeline:

  • Compile errors — if make fails, the agent reads the errors, fixes the C source, and retries up to 3 times
  • Memory safety — the binary is run under valgrind --leak-check=full to catch leaks and segfaults before delivery
  • Logic audit — the agent reviews the generated C for race conditions, NULL pointer dereferences, off-by-one errors, and semantic bugs
  • Missing deps — build tools and headers are auto-installed via your system package manager with sudo. If sudo fails, you'll get a clear message with instructions to re-run with sudo uvx transpilatron ...

Limitations

  • Linux and macOS only
  • torch / tensorflow not supported in --minimal mode
  • Some dynamic Python patterns (metaclasses, heavy monkey-patching) may not translate cleanly
  • Complex projects may occasionally require manual fixes

Examples

examples/
├── sieve.py      # Prime number sieve — 24x speedup
├── sort.py       # Selection sort — 58x speedup
└── web.py        # Flask app → C HTTP server, valgrind clean

Comparison

While tools like Nuitka and PyInstaller package the CPython interpreter to guarantee compatibility, transpilatron completely strips the CPython runtime. By translating Python logic into pure C, it produces binaries that run in environments with zero external libraries.

Tool Approach CPython Runtime? Fully Static Binaries? Output Size Ideal For
transpilatron Source-to-source C translation via LLM No Yes (--minimal) / Optional (--full) < 1MB CLI tools, microservices, serverless, initramfs, scratch containers, embedded, web apps
Nuitka Translates Python to C calling CPython APIs Yes No ~30MB+ Maximum CPython compatibility
PyInstaller Bundles Python interpreter + .pyc files Yes No ~30MB–100MB+ Desktop app distribution
Cython Compiles Python/Cython to extension modules Yes No N/A Accelerating hot paths in Python
PyPy Alternative JIT interpreter Yes No N/A Long-running server workloads

Why uv?

uv is the fastest Python package manager on the planet. uvx lets you run any Python tool instantly without installing it. If you're not using uv yet, you should be.


transpilatron was originally created to compile standalone initramfs boot scripts for Noodlix, a Python-only operating system — but works for many Python applications.

--minimal mode outputs fully static binaries. Runs even in initramfs. No dynamic linker required.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

transpilatron-10.0.0.tar.gz (264.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

transpilatron-10.0.0-py3-none-any.whl (12.8 kB view details)

Uploaded Python 3

File details

Details for the file transpilatron-10.0.0.tar.gz.

File metadata

  • Download URL: transpilatron-10.0.0.tar.gz
  • Upload date:
  • Size: 264.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for transpilatron-10.0.0.tar.gz
Algorithm Hash digest
SHA256 41d94694e0a4c690451e663b70104865a513a1f6ba02d85f57a5b6f674eff2f4
MD5 f81added4fec7464f75adcde87c6ed8e
BLAKE2b-256 115697289ae99c9ab566ec4c545f9b1ca41073fa35eab0481bf8c46aa7b1ba3d

See more details on using hashes here.

File details

Details for the file transpilatron-10.0.0-py3-none-any.whl.

File metadata

  • Download URL: transpilatron-10.0.0-py3-none-any.whl
  • Upload date:
  • Size: 12.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for transpilatron-10.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d0390b0362acf7cc8662f011b0e061863d8efe5db389483f7fda82518a5aa3ad
MD5 82703a400b79c2bcbf6b35785ec3f5a5
BLAKE2b-256 36885faaf8744940c5af2341ead15270293871d4913574c9dd974527923cb4a0

See more details on using hashes here.

Release history Release notifications | RSS feed

11.0.0

2 files

This release

10.0.0 This release

2 files

9.0.0

2 files

8.1.0

2 files

8.0.0

2 files

7.0.2

2 files

7.0.1

2 files

7.0.0

2 files

6.0.0

2 files

5.2.0

2 files

5.1.0

2 files

5.0.0

2 files

4.1.0

2 files

4.0.0

2 files

3.4.1

2 files

3.4.0

2 files

3.3.0

2 files

3.2.0

2 files

3.0.0

2 files

2.1.1

2 files

2.1.0

2 files

2.0.1

2 files

2.0.0

2 files

1.1.0

2 files

1.0.7

2 files

1.0.6

2 files

1.0.5

2 files

1.0.4

2 files

1.0.3

2 files

1.0.2

2 files

1.0

2 files

0.1.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page