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
def every_other_rev(xs: list[int]) -> int:
    # xs[::-2] — reverse, then take every 2nd element.
    return sum(xs[::-2])


def every_third_rev(xs: list[int]) -> int:
    return sum(xs[::-3])


def full_reverse(xs: list[int]) -> int:
    # xs[::-1] still routes through the reverse path.
    return sum(xs[::-1])