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
# PMAT-1078 (file I/O, append): `open(P, "a").write(S)` and
# `with open(P, "a") as f: f.write(S)` append (create-if-absent) instead of
# truncating — Stmt::FileWrite gains an `append` flag emitting
# OpenOptions::new().create(true).append(true) + write_all. Verified vs
# CPython (append accumulates; "w" still truncates).
def build_log(p: str) -> str:
    open(p, "w").write("")
    open(p, "a").write("A")
    open(p, "a").write("B")
    with open(p, "a") as f:
        f.write("C")
    return open(p).read()