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
def sum_squares(xs: list[int]) -> int:
    return sum([x * x for x in xs])


def max_abs(xs: list[int]) -> int:
    return max([abs(x) for x in xs])


def count_positive(xs: list[int]) -> int:
    return len([x for x in xs if x > 0])