Tag: Project

Small Python v0.4.0: Close to CPython Speed

This is a follow-up to the Small Python idea. I burned one more day of tokens to benchmark it and improve the performance. The setup is the same: one single Claude Code session, with /remote-control enabled so that I can prompt it while I’m out. In the morning I attended a local farm event, and in the afternoon we went trick-or-treating for Halloween.

The agent is capable of finding opportunities and fixing them correctly. Often it can run a few hours before it prompts me with more potential things to fix. I generally just ask it to continue.

At one point it stopped and claimed it wouldn’t gain much more, while it was still 1.3x–1.5x slower than CPython. I gave it a few ideas, and now it runs at 0.98x–1.1x of CPython.

In the end, I’m more than happy to ship a new version: Small Python v0.4.0.

Building a Single-File Python Interpreter

I’m working on a fun project: small-python. Implement a QuickJS-like single C11 source file that can do the same for Python language core, no Lib included. This goal is ambitious and it could be used for agents to run untrusted code.

To make that happen, I cannot simply say “hey Claude, implement a QuickJS-like project but for Python.” Instead, a few constraints are needed:

I’ve burned about $450 so far. Mostly using one single Claude Opus 5.5 session. The agent has been running for two days, and I’m steering, playing with my son, or going to sleep in the middle. Typically one steering session can run for several hours as I often say “don’t stop until.”

To be fair, I peeked at the C code once. It’s pretty understandable—just like the C parser code I wrote over the years. Nothing magic, but it’s substantial already.