Public · Gentle intro

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).

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.
So we never say “fix your Python first, then bring it.” Keep your Python as it is. SlimePython does not correct Python's dynamism — it preserves it. That's the core idea.

Being honest

We do not promise “perfect” for all code. Things like clock, randomness, network — the parts of Python that change on every run — can't be made bit-identical by anyone; they are outside the bit-exact guarantee (we say so plainly rather than hide it).
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.).