Jupyterfication and Reactive Computing with JavaScript

Department of Software Engineering and Algorithms

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.

Numerical and Algorithmic Computing in JavaScript

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.

Algorithmic Performance Analysis (Fibonacci & Complexity)

In the following block, we run a JavaScript script that computes Fibonacci sequence terms and execution statistics:

Chart 1. Algorithmic Performance of the Fibonacci Sequence in JavaScript
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
Source: Prepared via Node.js Engine (MarkCharm JavaScript Bridge).
Notes: Table values were dynamically generated at compile time by Node.js.

3D Chaotic Simulation: The Lorenz Attractor in JavaScript

The Lorenz Attractor is a system of ordinary non-linear differential equations that models chaotic atmospheric convection:

\[\frac{dx}{dt} = \sigma (y - x), \quad \frac{dy}{dt} = x (\rho - z) - y, \quad \frac{dz}{dt} = x y - \beta z\]
(1)

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:

Figure 1. Interactive 3D Simulation of the Lorenz Attractor in JavaScript
Step: 0 / 1200
Source: Interactively generated in JavaScript via 3D Canvas and dynamic calculation in Node.js.

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.


Caveats and Usage Requirements

Note

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).