A JavaScript engine.

An ECMAScriptECMAScript is the language specified by ECMA-262. GocciaScript uses modern recommended defaults while tracking conformance with generated test262 reports. engine for embedding, with sensible defaults that are easy to customize. The host defines the available capabilities, runtime surface, and execution limits.

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

Latest version 0.17.0 released November 8, 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 report has 98,951 of 103,360 runs passing (95.7%; non-strict 95.9%, strict 95.6%); 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; an embedder opts in through the engine's EnableEval option.

Open the live compatibility dashboard.

Modern by default

Modern ECMAScript forms first — let/const, arrow functions, classes, modules, async/await.

Made for embedding

A host chooses the runtime surface, grants capabilities explicitly, and sets execution limits. GocciaRunner's sandbox mode, with copied-in VFS snapshots and structured results, is a reference host for AI-agent code.

Explicit over clever

Strict equality and explicit imports by default; compatibility flags are supported customization that turns on implemented forms the recommended profile leaves out.

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 installedengine option EnableEval only (no CLI flag)ECMA-262 core
Function()YesDisabled--unsafe-function-constructorECMA-262 core
ShadowRealmYesNot installed--unsafe-shadowrealmTC39 Stage 2.7

Compatibility flags are supported customization: each turns on an implemented form the recommended profile leaves out. Dynamic source exposure is separate: evalis installed only when an embedder opts in through the engine's EnableEval option, 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. Node compatibility is to a degree, as runtime extensions a host installs: GocciaScript provides a Node.js capability when it fits the vision and cannot be shimmed in userland, and leaves what userland can shim to userland. The same rule covers CommonJS and the general node: modules. Bare-specifier lookup through node_modules (ESM only) is opt-in with --allow-import=node_modules.

Native platform

Made for embedding, portable by design.#

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 an ECMAScript engine for embedding, with sensible defaults that are easy to customize. Hosts define the available capabilities, runtime surface, and execution limits, and GocciaRunner's sandbox mode is a reference host for code that AI agents generate. 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 made for embedding in native applications.
It is an ECMAScript engine for embedding: an application adds scripting by embedding it, installs the runtime surface it needs, and grants capabilities explicitly. Different hosts get runtime extensions for their use case: a virtual filesystem, Node.js compatibility to a degree, and web-standard APIs (fetch, URL, TextEncoder/TextDecoder, Blob, AbortController and EventTarget today, with the ones React server rendering relies on, such as MessageChannel, ReadableStream and crypto, planned). GocciaRunner's sandbox mode, a runtime for code that AI agents generate, is a reference host built on the same capability model.
GocciaScript implements core ECMAScript and publishes generated test262 results; it aims to pass all of test262 in every mode test262 requires, strict and non-strict, and it tracks TC39 proposals, including stage 1 and 2. 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: a host changes them with Engine.Compatibility, and there are no presets. Normal hosts do not install eval; an embedder opts in through the engine's EnableEval option. Annex B's legacy browser features are part of the test262 conformance target: the ones that already ship stay as they are, always on or behind their existing flags, and new ones will go behind an opt-in Engine.Compatibility flag, also exposed as a --compat-* CLI 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 provides a Node.js capability when it fits the vision and cannot be shimmed in userland, and leaves what userland can shim to userland. The same rule covers CommonJS and the general node: modules. It is Node-compatible to a degree, through runtime extensions a host installs: node:async_hooks; bare-specifier lookup through node_modules (ESM only, a subset of Node's resolver), which is opt-in with --allow-import=node_modules; and a Node-compatible fs API over a virtual filesystem, which GocciaRunner's sandbox mode provides, with synchronous, callback, and promise-based methods, Stats objects, and Node-shaped errors. The documented method set stays inside the virtual filesystem 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 provides a web-standard API when it fits the vision and cannot be shimmed in userland, and the APIs React server rendering needs are planned, but it does not currently 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 and scripts, not CommonJS) covers what you run.
Scripts have no ambient host filesystem, process, native FFI, or network authority by default. Sandbox mode, the reference host for code that AI agents generate, 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