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
9
10
11
12
13
14
15
16
17
18
def items(n: int) -> str:
    return "%d items" % n


def kv(k: str, n: int) -> str:
    return "%s=%d" % (k, n)


def frac(x: float) -> str:
    return "%f" % x


def pct(n: int) -> str:
    return "100%% of %d" % n


def two(a: str, b: str) -> str:
    return "%s and %s" % (a, b)