Skip to content

PerryTS/starter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Perry Starter

A minimal starter project for Perry, a TypeScript-to-native compiler.

Prerequisites

  • Perry compiler built and available
  • Node.js (for benchmark comparison)

Hello World

Compile and run:

perry compile src/main.ts -o dist/hello
./dist/hello

Expected output:

Hello from Perry!
2 + 3 = 5
Doubled: [2, 4, 6, 8, 10]
Counter: 3

Benchmarks

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.ts

Example 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).

Project Structure

perry-starter/
├── perry.toml          # Perry project config
├── src/
│   ├── main.ts         # Hello world entry point
│   └── benchmark.ts    # Performance benchmarks
└── dist/               # Compiled binaries (git-ignored)

About

Starter project for Perry, a TypeScript-to-native compiler. Hello world + benchmarks.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors