Porffor is an ahead-of-time JavaScript compiler that outputs WebAssembly or native binaries, achieving 10-30x smaller and faster WebAssembly output than existing JS-to-Wasm projects by compiling rather than bundling an interpreter.
JS compiled to Wasm enables sandboxed execution for secure server-side hosting and edge runtimes, with low overhead compared to JITs, allowing more customers on the same hardware.
Compilation to native binaries reduces sizes up to 1000x (e.g., from ~90MB to <100KB), enabling JS use in embedded systems, game consoles, and tiny CLI apps under 1MB.
Porffor compiles JS to C then to native, works anywhere C works, and natively supports TypeScript without a build step.
It is written in JS with 0 eval for safety, performs static analysis for optimizations, and avoids the trade-offs of interpreters or multiple JIT tiers by compiling first and running later.
Drawbacks include lack of dynamic JS evaluation (like eval) and early-stage incompleteness, but it is tested against the Test262 conformance suite every commit.