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
# PMAT-504b (Tranche 2): multi-parameter + nullary closures.
def add(a: int, b: int) -> int:
    f = lambda x, y: x + y
    return f(a, b)


def nullary() -> int:
    g = lambda: 42
    return g()


def combine(a: int, b: int, c: int) -> int:
    h = lambda x, y, z: x * y + z
    return h(a, b, c)