xpile 0.1.616

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
8
def safe(a: int, b: int) -> int:
    try:
        return a // b
    except ZeroDivisionError:
        return -1
def main() -> None:
    print(safe(10, 2))
    print(safe(10, 0))