HN
Today

NormalScript: A perfectly normal scripting language

NormalScript presents itself as a straightforward embedded JavaScript VM for Node/Bun, designed for small scripts and agent code with unique suspend/resume capabilities. However, its website cleverly hides a mind-bending, psychedelic visual experience that transforms based on user interaction and browser capabilities, becoming a masterclass in web creativity. This unexpected duality sparked widespread fascination and discussion on Hacker News, blurring the line between a practical tool and an experiential art piece.

75
Score
17
Comments
#12
Highest Rank
6h
on Front Page
First Seen
Nov 26, 8:00 PM
Last Seen
Nov 27, 1:00 AM
Rank Over Time
151213131417

The Lowdown

NormalScript is introduced as a compact, fast virtual machine for a subset of JavaScript, designed to embed seamlessly within Node.js or Bun applications. It aims to provide a lightweight environment for running user-defined scripts, plugins, or agent code directly within an existing application without needing a separate runtime or worker.

  • Pure JavaScript Embedding: Implemented as a pure JavaScript package with no WASM, native addons, or isolates, simplifying integration into Node (>=24) or Bun (>=1.4) projects.
  • Small and Fast: Compiles scripts to bytecode that run on a compact VM, designed for quick startup and execution without the overhead of booting a separate process.
  • Scripting Capabilities: Supports a modern, strict-mode JavaScript subset, including async functions, generators, classes, and top-level await/return, enabling complex workflows within defined limits.
  • Host Integration: Provides a plain, Promise-based API for host functions (Host.fn, Host.namespace) to interact with the embedding application, with automatic argument/result copying.
  • Suspend, Save, Resume: A key feature allowing scripts to pause execution, save their state to bytes (toBytes), and resume later (fromBytes, runtime.resume) in the same or another process.
  • Operational Limits: Includes configurable timeoutMs and maxOutputBytes, with fixed caps on string length, array size, pending promises, and host boundary nesting to ensure predictable behavior.
  • Compliance: Adheres to a specific subset of test262, explicitly detailing supported and unsupported JavaScript features (e.g., no timers, I/O, dynamic code, or full module loading; direct host integration is required for external needs).

In essence, NormalScript offers developers a controlled, secure, and performant way to allow arbitrary JavaScript logic to execute within their applications, managed by the host, with a unique capability for long-running, interruptible processes.

The Gossip

Psychedelic Pageantry & Persistent Puzzles

Many commenters were utterly captivated by the website's hidden, psychedelic transformation from "NormalScript" to "PsychoScript" upon interaction or specific browser configurations. There was significant discussion on how to trigger this experience—clicking a small tab/stamp, using incognito mode, or simply having WebGPU enabled—and why some couldn't see it (often due to WebGPU being disabled or cookies making the 'normal' version a one-time view). Users praised its creativity, describing it as 'mind-melting' and 'trippy,' while others debated the design choice of making the 'weird' version persistent after the first view, suggesting a more obvious 'discover/enter' mechanism.

Scripting Specifics & Solution Similarities

Beyond the website's theatrics, some users delved into the technical merits and positioning of NormalScript. The primary technical question revolved around how NormalScript differentiates itself from other JavaScript interpreters or embedded runtimes like Boa, especially regarding its promise of pure JavaScript embedding without WASM or native modules, and its unique suspend/resume capabilities. The discussion aimed to understand its specific niche and advantages within the ecosystem of embedded scripting solutions.

Weird Web Wonders & Nostalgic Nods

The peculiar and unexpected nature of the NormalScript website evoked a wave of nostalgia among commenters. Many reminisced about the early days of the internet, before commercialization and standardization, when the web was a much 'weirder' and more experimental place. The site was praised for capturing that spirit of genuine oddity and creative freedom, breaking from conventional tech marketing.