cd /news/artificial-intelligence/why-small-python · home › topics › artificial-intelligence › article
[ARTICLE · art-170165] src=julin.ai ↗ pub= topic=artificial-intelligence verified=true sentiment=↑ positive

Why Small Python

A project called Small Python, hosted at github.com/soasme/small-python, has built a lean Python interpreter in a single spy.h/spy.c pair of about 35,000 lines of code that runs in roughly 0.8x of CPython's time and uses a small amount of memory, according to its author. Small Python strips out the standard libraries except an optional sys module, so PyPI packages and uv do not work with it, and instead lets developers register host functions in Rust, Go or C; it also adds code metering so LLM-generated code can be aborted, paused or resumed, which the author says CPython would never have. The toolchain can compile Python together with Go/Rust/C, producing a mini Minecraft clone binary of less than 3MB, and the roadmap covers distributed sandboxing workers, coding agent integrations and tracking upstream Python.

read2 min views1 publishedNov 15, 2026

CPython is the official one; PyPy is a JIT. Jython is old. GraalPy needs the JVM. MicroPython is for chips. Pydantic Monty is… okay, the closest to what I need, but its subtle differences from CPython here and there are such a pain in the ass.

I want something super lean with the least surprises. Only the core Python language features and builtin functions are needed. Whatever CPython produces, Small Python produces too. For other capabilities, you register functions in your host language. It should also be metered, so that when the runtime runs LLM-generated code, it can abort, , or resume.

Small Python has a QuickJS-like architecture: one single spy.h/ spy.c (35k LoC so far). I trimmed all the standard libraries away, leaving only sys, which can change the interpreter behavior (and it’s optional). So many PyPI packages, and uv, won’t work with Small Python as of now. But removing the libraries doesn’t mean it is weak. It opens a new door to a wider language ecosystem: you can totally build host functions in Rust/Go/C and link them into the program.

Code metering is something CPython would never have. If a piece of code reaches its budget, it should be halted. If the code is d because a cloud worker was killed, the agent can resume it on another machine and keep executing. This is essential for a coding agent’s codemode to behave well, and Small Python is starting to support it. Since all executed Python code lives on the heap, with no recursive C, it’s safe to anywhere and resume later (on the roadmap 😄).

The performance outcome is amazing, though: it beats CPython’s speed (it runs in about 0.8x of CPython’s time) and only needs a tiny amount of memory.

Another feature I have always wanted over the past decades is compiling a Python app into a super small binary. None of the packaging tools can do that: you need to bundle Python, the packages, etc. Small Python can compile Python code together with Go/Rust/C. For example, a mini Minecraft clone built with the Small Python toolchain produces a binary of less than 3MB.

The roadmap going forward includes distributed sandboxing workers, coding agent integrations, tracking upstream Python, etc.

With all that said, small, fast, no surprises, and compilation are an unusual feature set in the Python world. And Small Python takes that tiny sweet spot.

── more in #artificial-intelligence 4 stories · sorted by recency
── more on @small python 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/why-small-python] indexed:0 read:2min 2026-11-15 · —