Docs / Data Structures

3.5 Strict Type Mode (AOT)

'use strict types' activates the static validator at compile time. With this, the AOT compiler eliminates dynamic type checks at runtime, enables stack allocations for local references (Escape Analysis), resolves method devirtualizations statically, and converts collection loops directly into vectorized SIMD blocks. The compiler employs a three-level gradient inference strategy: static CFG analysis promotes monomorphic variables to native types; user annotations are treated as binding; and genuinely polymorphic bindings fall back to the Variant Enum. This 'Bind Once' approach means type specialization is final at compile time — there is no deoptimization or reoptimization, guaranteeing deterministic performance with zero warm-up.

Static Strict Mode (Optimizations)
 1 "use strict types";
 2 
 3 function add(a: number, b: number): number {
 4 return a + b; // AOT compiler removes all dynamic overhead
 5 
 6 @dynamic
 7 function processarDinamico(x: any): any {
 8   return x + 1; // Fallback to dynamic type with slow coercions
 9 }

Direct benefits: 30% to 50% performance gain in hot path sections due to the absence of VM checks.

Found an error in the spec? Open a PR.
Official Version: 1.0 · May 2026