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
# PMAT-497 (Tranche 2): augmented subscript assignment d[k] += v / xs[i] += v.
# Desugars to d[k] = d[k] <op> v, reusing DictGet/Index + DictSet/IndexAssign.
def counts() -> dict[str, int]:
    d: dict[str, int] = {}
    d["a"] = 1
    d["a"] += 5
    return d


def bump(xs: list[int]) -> list[int]:
    i = 0
    while i < len(xs):
        xs[i] += 10
        i += 1
    return xs