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
16
from dataclasses import dataclass


@dataclass
class Box:
    value: int

    def get(self) -> int:
        return self.value


def bad() -> int:
    # `get` is an INSTANCE method, not a @staticmethod — calling it via the
    # class name (Python's unbound-method form) is unsupported and must be
    # rejected cleanly rather than emitting `Box::get(5)` (which needs `&self`).
    return Box.get(5)