A drop of
JavaScript, sandboxed.
A sandbox-first ECMAScriptECMAScript is the language specified by ECMA-262. GocciaScript uses modern recommended defaults while tracking conformance with generated test262 reports. runtime and toolchain for AI agents. The host defines the available capabilities, runtime surface, and execution limits.
bashcurl -fsSL https://www.gocciascript.dev/install | sh
Pre-1.0: the API is still in motion — expect breaking changes between any two releases until 1.0.
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.
Current generated evidence: 52,281 of 52,492 cases pass in the latest published non-Annex-B test262 run. 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 seeded 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 --test262-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/expect API. In GocciaSandboxRunner, the sandbox surface adds import-only fs and goccia modules backed by a seeded virtual filesystem, sandbox shell commands, nested execution, 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, npm package resolution, process, Buffer, or the general node: module set.
Portable by design, embeddable by choice.#
FreePascal is the cross-platform toolchain. Delphi support covers the complete shipped Win32 and Win64 application matrix under the same runtime semantics. Native application embedding remains an important secondary goal.
FreePascal
Builds the cross-platform command-line toolchain and provides the documented native embedding path.
Delphi 12
Repository projects cover every shipped application 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);