hn.today

A perfectly normal scripting language

psychoscript.com11 points2 comments
Screenshot of A perfectly normal scripting language

This presents NormalScript, a small JavaScript virtual machine for embedding in Node 24+ or Bun 1.4+, rather than a complete runtime. Its purpose is to let applications run short scripts, plugins, workflows, or agent-generated code in-process, without setting up WASM, native add-ons, workers, or a separate runtime. The host supplies the functions and data scripts can use; scripts can combine those capabilities with modern JavaScript features such as async functions, classes, generators, and top-level await. The Promise-first API supports timeouts and cancellation, and an optional Effect adapter is available. A central feature is the ability to pause a run, serialize its state to bytes, and resume it later with the same build and host globals. Durable host calls can continue across suspension.

The design prioritizes a compact, controlled environment, so scripts have no event loop, timers, ambient file or network access, DOM, module loading, or dynamic code execution. Imports only bind host-provided globals, and functions cannot yet be passed from scripts to host calls. Execution is largely deterministic, with documented exceptions for time, randomness, and UUID generation; output, collection sizes, and nesting also have fixed caps, but there is no general memory or step limit. The site reports 19,408 passing test262 files, 2,845 known-gap skips, and no failures, while noting the tests have not yet run in CI. It is MIT-licensed and aimed at teams that need scriptable behavior without adopting a full JavaScript runtime.

Read on psychoscript.com2 comments on Hacker News

Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.

More in Programming

The daily digest

Today's best Hacker News stories, summarized and screenshotted, one email a day.