xpile 0.1.13

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
# PMAT-466 regression (review #1): an annotated local declared inside a
# loop body but never mutated must NOT be emitted `let mut` — clippy
# `-D warnings` (the project's pre-push gate) rejects `unused_mut`. The
# mutability pre-pass must count a binding declaration once, not double
# it for being inside a loop (each iteration re-binds a fresh local).
def f(xs: list[int]) -> int:
    total: int = 0
    for x in xs:
        tmp: int = x
        total = total + tmp
    return total