Abstract
This document demonstrates the MarkCharm compiler's capability to execute JavaScript (Node.js) scripts at compile time with reactivity and transparent metadata injection (attrs and directives). We showcase computational algorithm solving, dynamic table generation, and an interactive 3D visual simulation of the Lorenz Attractor chaotic system in motion.
The JavaScript / Node.js ecosystem is widely used for data processing and web development. MarkCharm provides bidirectional integration that injects document attributes as native JavaScript objects (attrs and directives) and captures stdout output directly into the compiler AST.
In the following block, we run a JavaScript script that computes Fibonacci sequence terms and execution statistics:
| Term \(n\) | Fibonacci Value \(F_n\) | Golden Ratio \mbox{(\(F_n/F_{n-1}\))} | Status |
|---|---|---|---|
| \(F_{5}\) | 5 | 1.666667 | Converging |
| \(F_{7}\) | 13 | 1.625000 | Converging |
| \(F_{9}\) | 34 | 1.619048 | Converging |
| \(F_{11}\) | 89 | 1.618182 | Converging |
| \(F_{13}\) | 233 | 1.618056 | Converging |
| \(F_{15}\) | 610 | 1.618037 | Converging |
The Lorenz Attractor is a system of ordinary non-linear differential equations that models chaotic atmospheric convection:
With Edward Lorenz's classic parameters (\(\sigma = 10, \rho = 28, \beta = 8/3\)), the system exhibits deterministic chaotic behavior with the famous “butterfly wings” structure.
Below, Node.js integrates 1,200 numerical time steps and displays an animated interactive 3D canvas in JavaScript:
As demonstrated in chart “Algorithmic Performance of the Fibonacci Sequence in JavaScript” and illustrated in figure “Interactive 3D Simulation of the Lorenz Attractor in JavaScript”, JavaScript script execution by the MarkCharm compiler is performed with complete computational and visual fidelity.
To compile this document with active JavaScript code execution, ensure that the Node.js (node) runtime is installed on the system and available in PATH. If the binary is not found or script execution is disabled, the compiler will emit diagnostic MCE-SCR-003 (or MCE-SEC-001 in safe mode).