A drop of
JavaScript.
A sandbox-first ECMAScript 2027+ECMAScript is the language specified by ECMA-262. GocciaScript uses modern recommended defaults while tracking conformance with generated test262 reports.runtime implemented from scratch for tinkerers, embedding and AI agents.
curl -fsSL https://www.gocciascript.dev/install | shPre-1.0: the API is still in motion — expect breaking changes between any two releases until 1.0.
Modern JavaScript, without the quirks.#
What remains is a small, predictable language with a .
Modern by default
ECMAScript 2027+ forms first — let/const, arrow functions, classes, modules, async/await.
Sandbox-first
Seeded VFS snapshots, import-only fs/goccia modules, nested execution, explicit diffs, 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, TOML, YAML, CSV, JSONL and Markdown.
What's left out — and why#
Dynamic code construction and scope-changing syntax are left out to keep execution predictable in embedded runtimes. Coercive or legacy forms such as ==, var, and arguments have explicit alternatives. See Language for the per-feature rationale.
Compatibility flags primarily exist for ECMAScript conformance and legacy code. They can opt back into syntax such as var, function, and ASI via CLI or config flags.
The runtime is intentionally not Node.js host compatible: no CommonJS, no node: built-ins, no npm-style package resolution, and no Node host globals such as process or Buffer.
Beyond the language: runtime and sandbox APIs#
Everything ECMAScript gives you, 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.
GocciaScript questions, answered.#
Short answers to the questions people usually ask before trying or embedding the runtime.
What is GocciaScript?
GocciaScript is a sandbox-first ECMAScript runtime and toolchain implemented from scratch in Object Pascal. It runs JavaScript-family source through an interpreter or bytecode VM with host-controlled runtime capabilities.
What is GocciaScript for?
It is built for embedding scripts in desktop applications and for running generated code from AI agents with less ambient authority than a general-purpose host runtime. Embedding currently targets FreePascal hosts, with more host paths intended to grow over time.
Is GocciaScript Node-compatible?
No. GocciaScript is intentionally not a Node.js host environment: no CommonJS, no node: built-ins, no npm-style package resolution, and no Node globals such as process or Buffer.
Is GocciaScript a browser runtime?
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.
What is GocciaScript written in?
The engine and command-line tools are written in Object Pascal. FreePascal is the supported toolchain today; Delphi support should be possible, but is untested at the moment.
Is GocciaScript production-ready?
GocciaScript is still pre-1.0, so APIs and compatibility behavior can change between releases. With more than 80% of test262 passing, it is ready for serious experiments and bounded production embedding where the supported surface matches your needs.
How does the sandbox model work?
Scripts have no ambient host filesystem, process, native FFI, or network authority by default. GocciaSandboxRunner imports explicit seed baselines into a virtual filesystem, exposes fs/goccia as import-only modules, and reports sandbox writes as diffs instead of writing back to host paths.
How compatible is it with ECMAScript?
GocciaScript tracks ECMAScript compatibility through generated test262 reports. The compatibility dashboard shows the current main-branch result set.
Can GocciaScript run TypeScript or JSX source?
Yes, the source pipeline accepts TS/TSX annotations and JSX as input forms: type annotations are parsed and discarded, and JSX is rewritten before lexing and parsing continue.
How do I try GocciaScript?
Use the playground in the browser, or install the command-line tools from the installation guide.
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 is the same language — TS/TSX type annotations are parsed and discarded, and JSX is rewritten to function calls in a preprocessing pass before the lexer ever sees it. There is no separate type-checker.
const price = 2.5;
const qty = 3;
const total = price * qty;
console.log("total:", total);