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.

bash
curl -fsSL https://www.gocciascript.dev/install | sh

Latest version 0.16.0 released November 5, 2026

View install scriptOther install options →

Pre-1.0: the host API and flags may change between releases. Pin a version; the changelog lists what changed.

coffee-typed.ts
press Run or ⌘+Enter
Evidence

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.

ECMAScript compatibility

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.

Open the live compatibility dashboard.

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.

Recommended language profile

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.

FormImplementedDefaultEnablement / exposureSource
varYesDisabled--compat-varECMA-262 core
functionYesDisabled--compat-functionECMA-262 core
== / !=YesDisabled--compat-loose-equalityECMA-262 core
ASIYesDisabled--compat-asiECMA-262 core
labelsYesDisabled--compat-labelECMA-262 core
for (;;)YesDisabled--compat-traditional-for-loopECMA-262 core
for...inYesDisabled--compat-for-in-loopECMA-262 core
while / do...whileYesDisabled--compat-while-loopsECMA-262 core
argumentsYesDisabled--compat-arguments-objectECMA-262 core
non-strict ScriptYesStrict--compat-non-strict-modeECMA-262 core
withYesDisabled--compat-non-strict-modeECMA-262 core
evalYesNot installedprivate GocciaTest262Runner conformance hostECMA-262 core
Function()YesDisabled--unsafe-function-constructorECMA-262 core
ShadowRealmYesNot installed--unsafe-shadowrealmTC39 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.

Runtime surface

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.

Native platform

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.

FAQ

GocciaScript questions, answered.#

Short answers to the questions people usually ask before trying or integrating the runtime.

GocciaScript is a JavaScript engine for running code that AI agents and people write: a sandbox-first ECMAScript runtime. Hosts define the available capabilities, runtime surface, and execution limits. test262 runs on every pull request, where a regression fails CI, with live results; 17,000+ tests run on every change, the engine is fuzzed and memory-checked every night, and it runs in production as the engine behind Shotcup's hosted sandboxes. It has its own compiler, bytecode VM and garbage collector with no other engine underneath, built with FreePascal into native binaries, and can be embedded in native applications.
Its primary goal is JavaScript execution for AI agents under an explicit, host-defined capability model. The same runtime and toolchain also serve sandboxed automation, portable native applications, plugins, and desktop scripting; native embedding is an important secondary goal.
GocciaScript implements core ECMAScript and publishes generated test262 results. Its recommended profile keeps var, traditional function syntax, loose equality, labels, traditional for loops, for...in, while/do...while, ASI, arguments, and non-strict Script semantics disabled by default, but each has an explicit compatibility path. Those defaults are product policy, not the implementation ceiling. Normal hosts do not install eval; the private test262 host exposes it for conformance. Annex B's legacy browser features are part of the test262 conformance target; new ones will go behind an opt-in compatibility flag.
GocciaScript implements the TC39 Type Annotations proposal and its types-as-comments runtime model: supported annotations have no runtime effect by default. The optional --strict-types GocciaScript extension adds runtime enforcement for supported annotations and inferred primitive contracts. It is not a replacement for a static structural type checker such as tsc.
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, a subset of Node's resolver) is opt-in with --allow-import=node_modules. GocciaRunner's sandbox mode does provide a Node-compatible fs API over its virtual filesystem, with synchronous, callback, and promise-based methods, Stats objects, and Node-shaped errors. The documented method set stays inside the sandbox and does not expose the ambient host filesystem.
GocciaScript's built-in runner uses the Vitest and Jest test API: describe, test, expect, lifecycle hooks, and mocks. Matcher and comparison semantics — equality, Set and Map, errors, and toThrow — are probed against a pinned Vitest release and reconciled against it, and shared differential suites run in CI against whichever runtime is the semantics oracle for each one: Vitest for the testing-API suites, Bun for the language suites, with Bun advisory on matcher and lifecycle behaviour rather than deciding it. Being a drop-in replacement is the direction, not a finished claim: importing vi from "vitest" resolves to a bundled compatibility shim that covers vi.fn, vi.spyOn, factory-form vi.mock (a synchronous arrow factory returning an object literal, with no automock and no spread-based partial mock), vi.unmock, vi.mocked, the global stubs (vi.stubGlobal, vi.unstubAllGlobals), the bulk mock helpers (vi.clearAllMocks, vi.resetAllMocks, vi.restoreAllMocks), and the fake-timer family (vi.useFakeTimers, vi.advanceTimersByTime, vi.runAllTimers, and the rest, over a deterministic virtual timer queue), so suites built on those run unchanged; vi.stubEnv and vi.unstubAllEnvs work over a host-injected process.env, since the engine has no process of its own, and members the shim does not implement — vi.waitFor, vi.waitUntil, vi.hoisted, vi.doMock, vi.doUnmock, vi.resetModules, vi.importActual, vi.importMock, vi.setConfig, and vi.resetConfig — throw a named error instead of failing quietly; vi is reached through that import rather than as an ambient global, and a few divergences are deliberate. Suites run as a single native binary with no Node.js installation or transform step in front of them, which is a statement about what a run has to do rather than about raw engine throughput.
No. It implements selected web-standard APIs where they fit the sandboxed runtime and embeddable-platform goals, but it does not provide a DOM, Web Workers, storage APIs, or a full browser event loop.
FreePascal is GocciaScript's cross-platform toolchain and builds every shipped binary. The repository also includes Delphi 12 Community Edition projects for its Win32 and Win64 application matrix: the REPL, Runner, Bare Script Loader, Test Runner, Benchmark Runner and Bundler. The Delphi support contract covers those six applications and all applicable Pascal and JavaScript tests, with shared runtime semantics across both compilers.
It runs in production as the engine behind Shotcup's hosted sandboxes (shotcup.dev). test262 runs on every pull request, where a regression fails CI, with the live result on the compatibility page; 17,000+ tests run on every change, and the engine is fuzzed and run under memory checkers every night and GC-stress-tested every week. It is pre-1.0, so the host API and command-line flags can change between releases: pin a version, and check that the supported surface (ES modules, no CommonJS, no general node: modules) covers what you run.
Scripts have no ambient host filesystem, process, native FFI, or network authority by default. GocciaRunner's sandbox mode copies explicit inputs into a virtual filesystem, exposes fs, goccia and goccia:search as import-only modules, and reports sandbox writes as diffs; only inputs copied with --copy-rw are written back, and only after a successful run.
GocciaScript tracks ECMAScript compatibility through generated test262 reports. The compatibility dashboard shows the current main-branch result set.
Yes. GocciaScript runs .js, .jsx, .ts, .tsx, .mjs and .mts files directly, with no separate transform step. Type annotations, interfaces and type aliases follow the TC39 Type Annotations proposal's types-as-comments model and are erased, and enum declarations follow the TC39 enum proposal. JSX in .js, .jsx, .tsx and .mjs files (with a warning in .js and .mjs) is rewritten into createElement calls before lexing, so your code supplies createElement and Fragment; in .ts and .mts a leading < is always type syntax. TypeScript syntax outside that model, such as namespaces and constructor parameter properties, is not supported; the type annotations guide lists it. GocciaScript does not type-check statically: use tsc for that; the optional --strict-types flag enforces supported annotations at run time.
Use the playground in the browser, or install the command-line tools from the installation guide.
Compiler pipeline

From source to result.#

One pipeline, five stages. Click a stage to jump into the matching docs chapter — start with Architecture.

Step 1 of 5

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.

example.js
const price = 2.5;
const qty = 3;
const total = price * qty;
console.log("total:", total);
Read more in Language