Edge Python. That’s the tiny Python 3.13 compiler – all in Rust, sipping under 200kb – that blew up on Reddit last time. Everyone figured it’d stay a curiosity, a proof-of-concept for masochists dreaming of embedded Python without the bloat. But this update? It flips the script.
A full stop-the-world mark-sweep garbage collector. Proper VmErrs everywhere. Overflow fixes on the math ops. Suddenly, it’s not just parsing bytecode – it’s running real code without crashing like a drunk intern.
Here’s the dev’s own words on the big leaps:
Full stop-the-world mark-sweep garbage collector (inspired by Ierusalimschy) with string interning (less or equal 64 bytes), free-list reuse, and allocation-count triggering.
All unimplemented opcodes now return proper VmErr errors instead of silent no-ops.
Ierusalimschy? That’s Roberto from Lua fame. Smart borrow – Lua’s VM is the gold standard for tiny and fast. But Python? Fat, interpreted, GC’d to hell. Edge Python’s squeezing it into a thimble.
What Nobody Expected: fib(45) in 11 Milliseconds
CPython 3.13 chews 1 minute 56 seconds on recursive fib(45). Edge Python? 0.011 seconds. Blinks and it’s done.
Sure, the dev admits template memoization from SSA turns recursion into O(n) after warmup. Fair point – feels like cheating if you’re benchmarking raw interpreter speed. But the 1-million-iteration loop? Edge at 0.056s, CPython 0.058s. Neck and neck.
Look. We’ve seen this before. Remember LuaJIT? Crushed CPython on numerics back in 2010, then stalled on full Python compat. Or PyPy – JIT magic, but balloons to gigabytes. Edge Python’s staying lean. 200kb total. That’s MicroPython territory, but aiming for full 3.13.
And the fixes? Integer overflows now use i128 with float promotion. Dict keys stable via string interning and recursive eq. Empty tuples, slicing, zip – all working. WASM heap bugs squashed.
This isn’t vaporware anymore.
But here’s my unique take, one you won’t find in the Reddit thread: this smells like the next edge computing killer for IoT. Not servers – who runs Python there anyway? Nah. Think Raspberry Pi Zero, ESP32, drones. Full Python semantics in 200kb? You slap this on a microcontroller, run ML inference scripts without TensorFlow Lite’s cruft. Prediction: by 2026, we’re seeing Edge Python in Home Assistant forks or Arduino libs. Who profits? Not Google. Indie hardware hackers and Rust evangelists.
Does Edge Python Beat CPython for Real?
Short answer: on toys, yes. On real apps? Jury’s out.
That fib benchmark’s viral bait – everyone loves a speed demon. But Python’s pain is lists-of-lists-of-dicts, network calls, regex hell. Edge hasn’t touched those yet. GC’s mark-sweep, stop-the-world – fine for bursts, but pause times kill responsiveness in loops.
Dev’s transparent, though. Non-recursive loops match CPython. And SSA form enables future JIT tricks. Inline caching on deck, per the repo. Roadmap teases it.
Cynical me asks: why? CPython’s free, battle-tested. This is a solo dev, Dylan Sutton-Chavez, grinding nights. GitHub’s at https://github.com/dylan-sutton-chavez/edge-python/tree/main/compiler. Fork it, sure. But production? Risky.
Still, the PR spin’s minimal – no “revolutionary” BS. Just benchmarks and commits. Refreshing in Hype Valley.
Overflow handling’s clever: i128 intermediate, checked int or float. No more wrapping to garbage. Dicts now hash stable – intern short strings, recurse on containers. That’s table stakes for Python, but Edge had ‘em broken.
Empty tuple literals? Default params? Slicing? Check, check, check. Generalized zip with O(n) dedup via HashSet. WASM fixes mean browser ports possible.
Why Bother with a 200kb Python VM?
Silicon Valley’s chasing AGI behemoths – trillion params, data centers guzzling nukes. Meanwhile, edge devices starve for scripting.
MicroPython’s great, but subsets Python. CircuitPython adds batteries. Both bloat past 500kb easy. Edge? Pure 3.13 bytecode, no CPython deps. Rust safety underneath – no segfaults.
Who makes money? Not the dev (yet). But ARM chip makers love this. Firmware updatable in Python? Flash a .pybc, tweak logic OTA. No C recompiles.
Downsides. Stop-the-world GC pauses microsends, ok for batch, sucks for UI. No threads yet. Unimplemented ops error out – progress, but scripts crash.
Dev’s crowdsourcing project mgmt. Notion board now, begs for tips. Linear? Trello? I’ve seen solo heroes drown without structure. Github Issues might suffice.
The Money Angle Nobody Asks
Always my question: who’s cashing checks?
Nobody, yet. Pure passion project. 351 upvotes last post – Hacker News next? If it hits HN frontpage, sponsors roll in. GitHub stars buy GPUs.
Corporate angle? Red Hat funds PyPy. Could Qualcomm eye it for Snapdragon edge? Nah, too niche. But AWS IoT or Azure Sphere? They’d rebrand it.
Skeptical vet says: watch the bloat creep. “Just one more opcode” turns 200kb to 2MB. Fight it.
Benchmarks table for posterity:
| Runtime | fib(45) real |
|---|---|
| CPython 3.13 | 1m 56s |
| Edge Python | 0.011 s |
(1M iters: Edge 0.056s vs CPython 0.058s)
Impressive. But run your own – clone, cargo build, test.
🧬 Related Insights
- Read more: MnemoPay SDK: AI Agents Get Memory and a Piggy Bank
- Read more: Drag Your To-Dos into Reality: A Kanban Beast Built on Django and MongoDB
Frequently Asked Questions
What is Edge Python?
A Rust-written compiler/VM for Python 3.13 bytecode, total size under 200kb, with SSA optimizations and now a mark-sweep GC.
Does Edge Python run full Python scripts?
Mostly – core ops yes, but some advanced features error out with VmErr. Getting there fast.
Is Edge Python faster than CPython?
Blazing on recursive fib due to memoization; loops on par. Real-world? Test your code.
Can I use Edge Python for embedded devices?
Absolutely the goal – tiny footprint screams IoT, MicroPython rival without subsets.