The Developer Guide Engine Internals

Architectural specification for engine maintainers, contributors, and AI pair-programmers extending the src/v8/ compiler.

1. The Architectural Story: From v1 to v8

Transforming complex enterprise payloads (Tally XML, SAP IDocs, SQL hierarchies) often starts with imperative scripts full of nested for loops and mutable object modifications. In production, this approach collapses when encountering optional fields, mixed types, or multi-megabyte payloads.

Over eight successive major revisions (v1 through v8), @keshavsoft/json-transformer was distilled from experimental prototypes down to a minimal, mathematically pure specification compiler:

⚡ 1.29 KB Minified Bundle

The entire v8 engine compiles to just 1.29 KB of native ES module JavaScript with zero third-party dependencies.

🛡️ Pure Functional Invariant

(inSource, inRecipe) → Output JSON. No mutations, no external state, and no side-effects.

📁 Architecture as Structure

Zero inline comments. System architecture is conveyed completely by directory hierarchy and semantic naming.

🔒 Scoped Execution

Strict parameter envelope: inputs are unpacked immediately to immutable local... constants.

2. Why Imperative Code Fails During Transfer

When software transfers data from an upstream Data Provider to a downstream Consumer, conventional developers write custom transformation loops. That model carries severe architectural flaws:

The Solution: A recursive co-traversal engine where the data shape is navigated declaratively. The engine code never changes; only the JSON recipe adapts.

Repository Roadmap: Explore the four developer modules to understand how v8 guarantees correctness: