Download Game! Currently 86 players and visitors. Last logged in:BadelkOdradekGlauriCilwand

Blitzer's Blog >> 72251

Back to blogs index
Posted: 10 Sep 2026 15:59 [ permalink ]
This is an incredibly pragmatic approach. By delegating side-effects and
domain-specific operations to external endpoints or a universal runtime like
the browser/NodeJS, you maintain the mathematical purity of the AST while
giving it infinite reach. It elegantly separates the logic from the
environment.
Here is a breakdown of why this dual-pronged strategy works so well and how it
shapes the architecture.
A) RPC/REST: The Network as the Interface
Relying on external endpoints effectively turns your network into a Foreign
Function Interface (FFI).
 * Agnostic Execution: The AST does not need to know if an operation is
executed by a local FastAPI service, a Cloudflare Worker edge tunnel, or a
human reviewing a queue. It simply formats a request, yields it, and processes
the response.
 * Asynchronous Orchestration: This maps perfectly to asynchronous
microservice architectures. The AST acts as the pure-logic orchestrator,
dispatching high-level intents and coordinating the resulting data streams.
 * Safe Sandboxing: Because the core logic engine cannot directly touch the
host filesystem or memory, it remains inherently secure. Any destructive
action must explicitly pass through a heavily validated RPC gateway.
B) NodeJS & HTML5: The Universal Host
Standardizing on the JavaScript ecosystem for system bindings is a brilliant
shortcut. The web platform has already done the heavy lifting of abstracting
OS-level differences across Windows, Linux, and mobile.
 * Ubiquitous Runtimes: Whether orchestrating Linux container setups and ZFS
storage pools via NodeJS, or manipulating a virtual file system and window
manager inside a browser using ServiceWorkers and IndexedDB, the underlying
JavaScript engine provides a consistent target.
 * The AST Catalog: An open-source catalog of bindings would essentially map
JSON-Lisp function names to JavaScript native equivalents. For example, the
AST form ["write-file", path, data] maps directly to Node's fs.writeFileSync,
while ["query-sql", stmt] could map to a WebAssembly SQLite instance in the
browser.
 * Zero-Overhead Bridging: In your current JL-AST setup, you can effortlessly
achieve this by injecting native functions into the global Env before booting
the VM. To the AST, calling a host function looks identical to calling a
user-defined function.
The Missing Link: Asynchrony
The only architectural hurdle remaining is how the AST handles asynchronous
operations. Since the executeVM loop is synchronous and relies on a
SharedArrayBuffer for polling, pausing the VM to wait for a REST response or
an IndexedDB query requires a mechanism to suspend and resume the execution
state.
How are you currently envisioning the AST handling asynchronous "awaits"will
you implement a robust continuation-passing style (CPS) within the compiler,
or rely heavily on the OP_YIELD instruction to hand control back to the host
thread until the promise resolves?