{"slug": "show-hn-transpilatron-an-ai-tool-that-converts-python-code-into-c-binaries", "title": "Show HN: Transpilatron – an AI tool that converts Python code into C binaries", "summary": "Transpilatron, a new AI tool, converts Python code into native C binaries without requiring C knowledge, achieving up to 58x speedups on benchmarks. The tool uses an AI agent to transpile Python projects to C, compiles them with -O2 or -O3 flags, and outputs fully static binaries with no runtime dependencies. It supports Linux and macOS, and is available via uv.", "body_md": "**Write Python. Get a native C binary. No C knowledge required.**\n\n```\nuvx transpilatron your_code.py\n```\n\n| Benchmark | Python | C | Speedup |\n|---|---|---|---|\n| Sieve of Eratosthenes (10M numbers) | 0.526s | 0.022s | 24x |\n| Selection sort (10K elements) | 1.963s | 0.033s | 58x |\n\nVerified on the same machine. Same output. Fully static binaries.\n\n```\nBenchmarker's PC:\n\nCPU: Ryzen 5 5500\n\nPython 3.14\n\nZorin OS 18\n```\n\ntranspilatron 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.\n\n- Reads your Python entry file and follows all imports\n- Transpiles the full project to C\n- Writes a Makefile and compiles (static linking for minimal, dynamic for usual)\n- Drops the binary in out/\n\n| Tool | Why |\n|---|---|\n|\n\nNote: You only need uv on your host machine. The AI agent automatically detects, installs, and configures all other development and verification dependencies (like C compilers, make, valgrind, and system headers) inside the build environment.\n\n```\n# Run without installing\nuvx transpilatron your_code.py\n\n# Or install globally\nuv tool install transpilatron\n```\n\nOn first run, the tool installs its dependencies and asks you to\nauthenticate with [poolside](https://poolside.ai/).\n\n```\n# Default mode (usual) — dynamic linking, libcurl, torch/tflite, web frameworks\nuvx transpilatron your_code.py\n\n# Minimal mode — fully static, raw sockets, no torch/tflite\nuvx transpilatron --minimal your_code.py\n```\n\nThe binary lands at `out/<your_code>`\n\n. That's it.\n\n- Pure Python logic → idiomatic C\n- HTTP (requests, urllib3) → raw BSD sockets (minimal) or libcurl (usual)\n- JSON → cJSON\n- Threading → pthreads\n- File I/O → POSIX syscalls\n- Multi-file projects → one binary\n- Detects and fixes common Python bugs during transpilation\n- Supports many major Python libraries with C extensions by using their C backends or alternatives\n- The system attempts to translate pure Python libraries as well\n- Web frameworks (flask, fastapi, django) → libmicrohttpd (usual only)\n- torch / tensorflow → libtorch / TFLite C API (usual only)\n\n| Mode | Default | Linking | HTTP | torch/tensorflow | Web Frameworks | Best for |\n|---|---|---|---|---|---|---|\n| minimal | Static only | Raw BSD sockets | Aborts with error | Not supported | Zero-dependency binaries for initramfs, scratch containers, embedded | |\n| usual | ✓ |\nDynamic permitted | libcurl | libtorch / TFLite C API | libmicrohttpd | General use, speed + versatility |\n\n- Linux and macOS only\n- torch / tensorflow not supported under minimal mode\n- Some dynamic Python patterns (metaclasses, heavy monkey-patching) may not translate cleanly\n\n```\nexamples/\n├── sieve.py      # Prime number sieve — 24x speedup\n└── sort.py       # Selection sort — 58x speedup\n```\n\nWhile tools like Nuitka and PyInstaller package the CPython interpreter\n(and its dynamic standard libraries) to guarantee compatibility,\n**transpilatron completely strips the CPython runtime**.\nBy translating Python logic into pure, dependency-free C, it allows you\nto build single, fully static binaries that run in environments with\nzero external libraries.\n\n| Tool | Approach | CPython Runtime Dependency? | Fully Static Binaries? | Output Size | Ideal For |\n|---|---|---|---|---|---|\ntranspilatron |\nSource-to-source C translation via LLM | No |\nYes |\n< 1MB | CLI tools, microservices, serverless, initramfs, scratch containers, embedded |\n| Nuitka | Translates Python to C calling CPython APIs | Yes | No | ~30MB+ | Maximum CPython compatibility |\n| PyInstaller | Bundles Python interpreter + .pyc files | Yes | No | ~30MB - 100MB+ | Desktop app distribution |\n| Cython | Compiles Python/Cython to extension modules | Yes | No | N/A | Accelerating Python code |\n| PyPy | Alternative JIT interpreter | Yes | No | N/A | Long-running server workloads |\n\n[uv](https://docs.astral.sh/uv/getting-started/installation/)\nis the fastest Python package manager on the planet.\n`uvx`\n\nlets you run any Python tool instantly without installing it.\nIf you're not using uv yet, you should be.\n\n*\ntranspilatron was originally created to compile standalone initramfs\nboot scripts for Noodlix, a Python-only operating system — but works\nfor many Python applications.\n*\n\n*\nminimal mode outputs fully static binaries.\nRuns even in initramfs. No dynamic linker required.\n*", "url": "https://wpnews.pro/news/show-hn-transpilatron-an-ai-tool-that-converts-python-code-into-c-binaries", "canonical_source": "https://github.com/NoodlixProject/transpilatron", "published_at": "2026-06-15 20:31:28+00:00", "updated_at": "2026-06-15 20:34:28.149651+00:00", "lang": "en", "topics": ["ai-tools", "developer-tools", "generative-ai"], "entities": ["Transpilatron", "poolside", "Ryzen 5 5500", "Zorin OS", "Nuitka", "PyInstaller", "Cython", "PyPy"], "alternates": {"html": "https://wpnews.pro/news/show-hn-transpilatron-an-ai-tool-that-converts-python-code-into-c-binaries", "markdown": "https://wpnews.pro/news/show-hn-transpilatron-an-ai-tool-that-converts-python-code-into-c-binaries.md", "text": "https://wpnews.pro/news/show-hn-transpilatron-an-ai-tool-that-converts-python-code-into-c-binaries.txt", "jsonld": "https://wpnews.pro/news/show-hn-transpilatron-an-ai-tool-that-converts-python-code-into-c-binaries.jsonld"}}