SlimePython — a gentle intro
In one line: it turns the Python you wrote into Rust that produces the exact same result. Not “roughly the same” — the output is byte-for-byte identical, and that is proven by SHA-256 (a hash).
A tool that converts the Python you wrote into Rust that produces exactly the same results. It proves 1-bit-identical output via SHA-256. No need to rewrite cleanly; dynamic parts run as-is in a safe Python sandbox.
Hand-porting Python to Rust drifts, but this generates Rust whose output is SHA-256 1-bit-identical. Dynamic parts are delegated to a CPython Isolate (95-99% under a pinned runtime); true nondeterminism is explicitly rejected. PoC 40/40 bit-exact, proven.
Not all-Python-to-Rust but static core→pure Rust (100% bit-exact) / dynamic→deterministic CPython Isolate / nondeterminism→reject (Hybrid Bit-Exact Isolate). Extends "don't understand the meaning, transcribe the structure" to the dynamic region — letting CPython itself generate the meaning.
Source projected as structure onto Slot IR. The dynamic region is delegated to a pinned CPython (PYTHONHASHSEED=0, fixed seed/clock, pinned libm) deterministic Isolate, joined at the boundary by canonical encoding. Under the AI-Trap-17 (fabricated empirical claims) avoidance policy, 100% is promised only for the static region.
📋 "Ask your AI at this level" copies this page's explanation with an instruction matched to the level you picked. Paste it into your own AI (Claude · GPT · Gemini · Grok) to dig deeper at that resolution.
Why is that nice?
- Python is easy to write — but for shipping, speed and safety, Rust is stronger.
- Normally, rewriting Python into Rust leaves you unsure whether it really behaves the same.
- SlimePython shows the output is identical down to the bit via a hash, so you don't need the “looks about right” checking work.
A simple example
Take some ordinary Python:
def greet(name):
return f"Hello, {name}!"
print(greet("World"))
The Rust it converts to also prints Hello, World! as the exact same bytes. Same input → the Python and Rust output hashes match — that's what “proven” means.
“But my code is dynamic and messy…”
That's fine. You don't need to rewrite it cleanly.
- The cleanly-convertible parts → become Rust directly.
- The dynamic, tricky parts (dynamic attribute access, rewriting,
eval, …) → run as-is inside a safe Python sandbox, and only the result is fixed.
Being honest
We value “actually using it and getting more productive” over “100% in theory.”
Want to go deeper?
SlimePython is the modern-language member of the SlimeNENC structural-translation family (the legacy side handles COBOL / JCL / RPG, etc.).
