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
8
9
10
11
12
13
14
15
16
def swap(a: int, b: int) -> tuple[int, int]:
    return (b, a)


def first(p: tuple[int, int]) -> int:
    return p[0]


def labelled(n: int, s: str) -> tuple[int, str]:
    # per-element types preserved: (i64, String)
    return (n, s)


def sum_pair(p: tuple[int, int]) -> int:
    a, b = p
    return a + b