NaideVM

NaideVM is NAIDE's direct AST interpreter. It executes NAIDE source on Node.js without generating JavaScript. The public class is NaideVM; NativeEngine remains as a backwards-compatible alias.

Experimental direct native tier

An opt-in Windows x64 tier compiles a conservative scalar-numeric function subset to machine code. Build the Node-API bridge from a source checkout with Visual Studio C++ Build Tools installed:

npm install
npm run build:native-jit

Enable direct compilation with new NaideVM({ nativeMachineCode: true }). To compile only after repeated calls, set nativeMachineCodeThreshold to a positive call count; this tier considers functions containing range loops and the exact dense numeric-array sum shape, while keeping low-benefit leaf helpers on the existing fast tier. The array specialization is limited to VM-owned numeric arrays and falls back after mutation or for other iteration semantics. The backend uses liveness-based allocation across volatile XMM registers with stack spills, and can inline bounded immutable pure numeric helpers with simple conditional returns. Inlining preserves branch outcomes, source-line step charges, and call-depth checks. The native compiler also recognizes exact zero-initialized accumulator loops (triangular sums, unit increments, and dense numeric-array sums), applies reductions only to guarded shapes, and still charges the original logical step budget. It supports integer remainder only for guarded range-iterator cases. Set nativeMachineCodeDiagnostics: true and read getNativeMachineCodeStats() for compile, inlining, code-size, native-call, warmup, and fallback counters. Unsupported functions and guarded arguments retain the existing NaideVM fast/interpreter fallback. Both modes are opt-in, Windows x64-only, and experimental.

Measured runtime comparison

This page compares the default NaideVM fast tier and, when the Windows x64 bridge is available, direct and hotness-tiered native machine code against Node.js/V8, Bun/JavaScriptCore, and Python/CPython. Each implementation must return the expected result before timing is reported. V8 is the performance gate; results are measurements from one host, not a general engine ranking.

Loading the checked-in benchmark measurements…