Installation
Install Porffor globally via npm:Basic Usage
Available Commands
Compile Commands
Run
Compile and execute JavaScript files
Wasm
Compile to WebAssembly binary
Native
Compile to native executable
C
Compile to C source code
Lambda
Compile to AWS Lambda deployment package
Analyze Commands
Profile
View detailed function-by-function performance
Debug
Debug JavaScript source with interactive debugger
Interactive Mode
REPL
Interactive Read-Eval-Print Loop
Global Flags
These flags work across all commands:Optimization level. Use
-O0, -O1 (default), -O2, or -O3-O0: Disable optimizations-O1: Basic optimizations (simplify instructions, treeshake Wasm imports)-O2: Advanced optimizations (partial evaluation) - unstable-O3: Maximum optimizations
Force parsing input as TypeScript
Debug mode - includes names in Wasm output and enables debug logs
Parse input as an ES module
Secure mode - errors on unsafe Porffor features (e.g., FFI)
Parser to use:
acorn, @babel/parser, meriyah, or hermes-parserEnable parsing TypeScript type annotations. If
--parser is unset, defaults to @babel/parserUse type annotations as compiler hints for optimization (does not type check)
Value type to use:
i32 or f64Advanced Flags
View all flags including experimental options:All Advanced Flags
All Advanced Flags
Print disassembled Wasm generated from user functions
Enable profile-guided optimization
Disable COCTC (cross-object compile-time cache)
Enable experimental Cyclone optimizer
Do not treeshake Wasm imports
Memory allocator:
oneshot or chunkException handling mode:
lut or stackNon-compliant optimization to make
.length fasterLog general compiler performance (enabled by default when compiling to file)
PRNG algorithm:
xorshift32+, xorshift64+, xorshift128+, xoroshiro128+, or xoshiro128+Getting Help
Running Code
Next Steps
Run Command
Learn about executing JavaScript files
Compile to Wasm
Build WebAssembly binaries
Profile Code
Analyze performance
REPL Mode
Interactive development