xpile 0.1.1

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
# PMAT-461 / v0.2.0 Track 1.B: indexed assignment `xs[i] = v`.
# Exercises Stmt::IndexAssign with param-mut threading. Verifies that
# in-place mutation via subscript-assignment works alongside the
# matching Expr::Index read.
def set_first(xs: list[int], v: int) -> int:
    xs[0] = v
    return xs[0]