xpile 0.1.615

Polyglot transpile workbench (Python/C/C++/Rust/Ruchy/Lean ↔ Rust/Ruchy/PTX/WGSL/SPIR-V) with provable contracts at every layer.
1
2
3
4
5
6
7
# PMAT-502b (Tranche 2): str.replace(old, new) -> .replace(&(old)[..], &(new)[..]).
def censor(s: str) -> str:
    return s.replace("bad", "***")


def swap(s: str, old: str, new: str) -> str:
    return s.replace(old, new)