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 grid_row_append(g: list[list[int]], i: int) -> int:
    # append on a list-of-list subscript receiver: g[i].push(...).
    g[i].append(99)
    return len(g[i])


def first_row_total(g: list[list[int]]) -> int:
    g[0].append(10)
    g[0].append(20)
    return sum(g[0])


def bucket_append(d: dict[str, list[int]], k: str, v: int) -> int:
    # append on a dict-of-list subscript receiver: d.get_mut(&k).unwrap().push(v).
    d[k].append(v)
    return len(d[k])