HTTP services
Serve handle(request) as wasi:http/handler@0.3.0. fetch, streams, timers and Promise combinators suspend through WASI 0.3 callbacks and resume directly from host events.
Perry-WIT compiles a static subset of TypeScript into standalone WASI 0.3 components, without bundling a JavaScript engine.
A simple integer add fits in 100 bytes. Components can keep state between calls while the runtime reclaims temporary allocations. 63 conformance contracts compare results with Node.js.
export function greet(name: string): string {
return "Hello, " + name;
}package example:greeting;
world greeting {
export greet: func(name: string) -> string;
}Serve handle(request) as wasi:http/handler@0.3.0. fetch, streams, timers and Promise combinators suspend through WASI 0.3 callbacks and resume directly from host events.
Generated .d.ts brings editor completion and tsc checks for WIT records, lists, variants and results. Write library functions or CLI commands with top-level await. Start with a Nix template.
Use ordinary TypeScript syntax for native signed and unsigned arithmetic. WIT ranges let the compiler widen only when needed and eliminate redundant array bounds checks.
NumbersCompile tenant TypeScript in memory through Rust's perry_wit::api, or run the WASI 0.2 compiler with fuel and memory limits. The compiler embeds the precompiled runtime and standard libraries, so compilation needs neither Rust nor LLVM.
nix build github:ahirner/perry-witperry_wit · API documentation