A minimal starter project for Perry, a TypeScript-to-native compiler.
- Perry compiler built and available
- Node.js (for benchmark comparison)
Compile and run:
perry compile src/main.ts -o dist/hello
./dist/helloExpected output:
Hello from Perry!
2 + 3 = 5
Doubled: [2, 4, 6, 8, 10]
Counter: 3
Compile and run the benchmark natively, then compare with Node.js:
# Compile with Perry
perry compile src/benchmark.ts -o dist/benchmark
# Run native binary
./dist/benchmark
# Run with Node.js
node src/benchmark.tsExample output (native vs Node.js):
=== Perry Benchmark === Perry Node.js
Fibonacci(40) = 102334155 in ___ms ~490ms ~1000ms
Array sum (10M) = 49999995000000 in ___ms ~2ms ~12ms
Object creation (1M) = 2999997 in ___ms ~0ms ~3ms
String concat (100K) in ___ms (100000 chars) ~2ms ~3ms
Timings will vary by machine. The recursive Fibonacci benchmark typically shows the largest speedup (~2x).
perry-starter/
├── perry.toml # Perry project config
├── src/
│ ├── main.ts # Hello world entry point
│ └── benchmark.ts # Performance benchmarks
└── dist/ # Compiled binaries (git-ignored)