Projects
View on GitHub
yaneurao/Pytra
About
Ultimate transpiler: converts Python to C++, Rust, C#, PowerShell, JavaScript, TypeScript, Dart, Go, Java, Swift, Kotlin, Ruby, Lua, Scala3, PHP, Nim, Julia, and Zig.
Languages & RuntimesWhat you can do
- 🌐 Transpiles to C++ / Rust / Go / Java / TS and many more
- 🧩 Preserves the original code structure almost entirely
- ⚡ Write in Python, generate high-performance code
- ✨ Simple Python subset input
Measured star growth
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- 0
- in 1 month
- Collecting history
Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.
docs/en/tutorial/README.md
OriginalTutorial
A starting point for first-time Pytra users.
Get Running in 3 Minutes
def add(a: int, b: int) -> int:
return a + b
if __name__ == "__main__":
print(add(3, 4))
Transpile this add.py to C++ and run it:
./pytra add.py --output-dir out/add_case --build --run --exe add.out
Output:
7
Reading Order
- How to use — Build steps, supported languages, main options
- Try the samples — Try the 18 sample programs
- Differences from Python — Type annotations, imports, unsupported syntax
- Troubleshooting — When you get stuck
- Exception handling — raise / try / except / finally
- Traits (interfaces) — Attaching multiple behavioral contracts to a type
- Union types and isinstance narrowing — Handling multiple types and automatic type refinement
- Available modules — Commonly used modules and functions
- Architecture — Pipeline overview and the role of each stage
Explore related projects
Loading…