A JavaScript engine.
A JavaScript engine for running code that AI agents and people write: a sandbox-first ECMAScriptECMAScript is the language specified by ECMA-262. GocciaScript uses modern recommended defaults while tracking conformance with generated test262 reports. runtime. The host defines the available capabilities, runtime surface, and execution limits.
bashcurl -fsSL https://www.gocciascript.dev/install | sh
Pre-1.0: the host API and flags may change between releases. Pin a version; the changelog lists what changed.
What you can check before you rely on it.#
Conformance
test262, the official ECMAScript conformance suite, runs on every pull request and on main, and a regression against main fails the pull request. The latest published run, Annex B excluded, has 50,498 of 52,665 cases passing (95.9%); see results by area on the compatibility dashboard.
Tested on every change
17,000+ JavaScript tests run on every pull request on Linux x64 and on six targets on main. Differential suites are checked against Bun and Vitest.
Fuzzing and memory checks
Every night, AFL++ fuzzes the engine and heap snapshot reader, and the full test suite runs under FreePascal's heap checker (heaptrc) and Valgrind memcheck. Every week, a GC-stress run collects garbage every 8 instructions across the whole test suite and the GC-sensitive part of test262.
In production
GocciaScript is the engine behind Shotcup's hosted sandboxes, where every run gets a fresh engine with hard limits.
Prebuilt for six targets
Every release and nightly has native binaries for macOS and Linux (x64 and arm64) and Windows (x64 and x86). Use the one-line installer or Homebrew on macOS.
The implementation is broader than the recommended profile.#
GocciaScript implements core ECMAScript. Modern, explicit forms are enabled by default; every standard core form disabled by the recommended profile has an explicit compatibility path. Normal hosts do not install eval, which is exposed only by the private test262 conformance host.
Modern by default
Modern ECMAScript forms first — let/const, arrow functions, classes, modules, async/await.
Sandbox-first
AI-agent execution with copied-in VFS snapshots, explicit modules and capabilities, structured results, and host-owned limits.
Explicit over clever
Strict equality and explicit imports by default; compatibility flags are reserved for conformance and legacy semantics.
A modern standard library, batteries included
Temporal for dates, and direct module imports of JSON, JSON5, TOML, YAML, CSV, TSV, JSONL and Markdown.
Vitest-compatible testing
Write tests the way you already do — describe/test/expect, lifecycle hooks, and mocks — with semantics probed against a pinned Vitest release, in a single native binary.
Implemented, with explicit defaults#
The profile is host policy, not a list of missing language features. The table distinguishes implemented semantics from their default exposure. See Language for the per-feature rationale.
| Form | Implemented | Default | Enablement / exposure | Source |
|---|---|---|---|---|
| var | Yes | Disabled | --compat-var | ECMA-262 core |
| function | Yes | Disabled | --compat-function | ECMA-262 core |
| == / != | Yes | Disabled | --compat-loose-equality | ECMA-262 core |
| ASI | Yes | Disabled | --compat-asi | ECMA-262 core |
| labels | Yes | Disabled | --compat-label | ECMA-262 core |
| for (;;) | Yes | Disabled | --compat-traditional-for-loop | ECMA-262 core |
| for...in | Yes | Disabled | --compat-for-in-loop | ECMA-262 core |
| while / do...while | Yes | Disabled | --compat-while-loops | ECMA-262 core |
| arguments | Yes | Disabled | --compat-arguments-object | ECMA-262 core |
| non-strict Script | Yes | Strict | --compat-non-strict-mode | ECMA-262 core |
| with | Yes | Disabled | --compat-non-strict-mode | ECMA-262 core |
| eval | Yes | Not installed | private GocciaTest262Runner conformance host | ECMA-262 core |
| Function() | Yes | Disabled | --unsafe-function-constructor | ECMA-262 core |
| ShadowRealm | Yes | Not installed | --unsafe-shadowrealm | TC39 Stage 2.7 |
Compatibility flags primarily serve ECMAScript conformance and existing code. Dynamic source exposure is separate: normal hosts do not install eval, and Function() requires the explicit --unsafe-function-constructor opt-in.
Beyond the language: runtime and sandbox APIs#
A broad ECMAScript surface, plus first-class structured-data formats — direct module imports of .json, .json5, .toml, .yaml, .csv, .tsv, .jsonl, and .md; runtime parsers for each (markdown imports return the raw text); import maps; console output; SemVer helpers; and a built-in test runner with a Vitest/Jest-compatible test/describe/expectAPI. In GocciaRunner's sandbox mode, the sandbox surface adds import-only fs, goccia and goccia:search modules backed by a virtual filesystem of copied inputs, sandbox shell commands, nested execution, file search, and explicit diffs.
The sandbox fs module provides Node-compatible synchronous, callback, and promise methods over that virtual filesystem, including Stats objects and Node-shaped errors. GocciaScript is not a complete Node.js host: it does not provide CommonJS, process, Buffer, or the general node: module set. Bare-specifier lookup through node_modules (ESM only) is opt-in with --allow-import=node_modules.
Portable by design, embeddable by choice.#
Native binaries for macOS, Linux and Windows, with GocciaScript's own compiler, VM and garbage collector and no other engine underneath: no other runtime to install beside the binary (HTTPS on Linux uses the system OpenSSL). FreePascal builds them, and Delphi 12 covers the Win32 and Win64 application matrix. Native applications can embed the engine with their own globals, modules, capabilities and limits.
FreePascal
Builds the cross-platform command-line toolchain and provides the documented native embedding path.
Delphi 12
Repository projects cover the REPL, Runner, Bare Script Loader, Test Runner, Benchmark Runner and Bundler on Win32 and Win64; the support contract includes all applicable Pascal and JavaScript tests.
Native embedding
Hosts can embed portable JavaScript and define application globals, modules, capabilities, limits, and result handling.
GocciaScript questions, answered.#
Short answers to the questions people usually ask before trying or integrating the runtime.
From source to result.#
One pipeline, five stages. Click a stage to jump into the matching docs chapter — start with Architecture.
Source
Every supported extension enters the same source pipeline. GocciaScript implements the TC39 Type Annotations proposal, so supported annotations have no runtime effect by default; --strict-types optionally adds runtime contracts. JSX is rewritten to function calls in a preprocessing pass before lexing.
const price = 2.5;const qty = 3;const total = price * qty;console.log("total:", total);