cd /news/developer-tools/i-built-a-python-c-transpiler-then-i… · home topics developer-tools article
[ARTICLE · art-34949] src=dev.to ↗ pub= topic=developer-tools verified=true sentiment=↑ positive

I built a Python -> C transpiler. Then it transpiled itself.

A developer built Transpilatron, an AI agent that transpiles Python code into fully static C binaries, achieving speedups of up to 58x on benchmarks. The tool successfully transpiled its own source code into a working C binary, and can convert Flask apps into native C HTTP servers with no Python runtime. Transpilatron is designed for environments like initramfs and scratch containers where no interpreter is available.

read2 min views1 publishedJun 20, 2026

A few weeks ago I needed to run Python scripts in initramfs — the tiny Linux environment that exists before your actual OS boots. No interpreter. No dynamic linker. Nothing.

So I built Transpilatron: an AI agent that takes Python code and produces a fully static C binary.

uvx transpilatron your_code.py

That's it. No C knowledge required.

First, does it actually work? I ran two tests:

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

Same output. Verified on the same machine. The C binary is fully static — no runtime, no interpreter, no dependencies.

Then I tried something more interesting. A 14-line 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)

One command:

uvx transpilatron web.py

Output: a native C HTTP server. No Flask. No Python runtime.

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

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

Verified memory-safe by valgrind: 0 errors, 0 leaks.

Here's where it gets weird.

Transpilatron is written in Python. So I pointed it at its own source code:

uvx transpilatron src/transpilatron/agent.py

The agent read its own Python source, wrote 400+ lines of C, fixed its own compiler errors autonomously, ran a memory audit, and produced a working binary.

$ ./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.

Valgrind result: 0 errors, 0 leaks.

Transpilatron wraps the Poolside CLI (free) as its agentic backend. The agent:

-O3

Mode Linking HTTP Best for
--minimal
Static only Raw BSD sockets initramfs, scratch containers, embedded
--full
Dynamic permitted libcurl Web apps, ML inference, general use

--full

mode supports Flask/FastAPI → libmicrohttpd, torch/tensorflow → libtorch/TFLite, OpenCV, and more.

Nuitka bundles CPython. PyInstaller bundles CPython. Both produce 30MB+ binaries that require a Python runtime.

Transpilatron strips CPython entirely. The output binary has no idea Python exists.

That's the only approach that works for initramfs, scratch containers, or embedded targets with no OS.

uvx transpilatron your_code.py

Requires only uv

. Everything else (Poolside CLI, gcc, make, valgrind) is auto-installed on first run.

GitHub: NoodlixProject/transpilatron

Transpilatron was originally built to compile boot scripts for Noodlix — a Python-only OS I'm building. That project is ongoing.

── more in #developer-tools 4 stories · sorted by recency
── more on @transpilatron 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/i-built-a-python-c-t…] indexed:0 read:2min 2026-06-20 ·