xpile 0.1.616

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
17
18
class Counter:
    count: int

    def __init__(self, count: int) -> None:
        self.count = count

    def incr(self) -> None:
        self.count = self.count + 1

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


def run() -> int:
    c = Counter(0)
    c.incr()
    c.incr()
    return c.get()