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-611: float(str) accepts PEP 515 underscore digit separators
# (float("1_000.5") == 1000.5), which Rust's parse::<f64>() rejects → panic.
# Python allows underscores only BETWEEN digits (covering the fractional and
# exponent parts); xpile validates that, strips, then parses.
def parse(s: str) -> float:
    return float(s)


# A string-LITERAL argument transpiles to a temporary `String`; the validation
# block must keep it alive (temporary lifetime extension), not drop it (E0716).
def parse_literal() -> float:
    return float("1_234.5")