惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

IT之家
IT之家
Last Week in AI
Last Week in AI
博客园_首页
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园 - 叶小钗
大猫的无限游戏
大猫的无限游戏
人人都是产品经理
人人都是产品经理
V
Visual Studio Blog
宝玉的分享
宝玉的分享
博客园 - Franky
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
月光博客
月光博客
T
Tailwind CSS Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
量子位
博客园 - 聂微东
S
SegmentFault 最新的问题
博客园 - 司徒正美
罗磊的独立博客
V
V2EX
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
美团技术团队
小众软件
小众软件
Jina AI
Jina AI

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
I built a Python -> C transpiler. Then it transpiled itself.
Johnny · 2026-06-20 · via DEV Community
Cover image for I built a Python -> C transpiler. Then it transpiled itself.

Johnny

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.

The benchmarks

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.

The Flask demo

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.

Then it transpiled itself

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.

How it works

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

  1. Reads your Python entry file and follows all imports
  2. Transpiles the full project to C
  3. Writes a Makefile and compiles with -O3
  4. Auto-installs missing build tools via your system package manager
  5. Runs the binary under valgrind to verify zero memory leaks
  6. Audits the C for race conditions, NULL dereferences, and logic bugs
  7. Retries up to 3 times if compilation fails

Two modes

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.

Why not Nuitka?

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.

Try it

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.