Arrival
Arrival evaluates Scheme inside a JavaScript application. Your application supplies the operations a program can call; Arrival evaluates expressions, passes values between them, and returns the results.
Harness uses it to let the model search, filter a tool result, and read selected files in one program. Composing tools explains that use. This page is for developers embedding the interpreter in another application; using Harness does not require a separate Arrival installation.
Install and run
Section titled “Install and run”@inhuman.tools/arrival is ESM-only. The repository targets Node.js 22 or newer.
npm install @inhuman.tools/arrivalimport { exec} from "@inhuman.tools/arrival";
const [result] = await exec( `(filter (lambda (x) (> x 5)) (list 1 3 7 9 2))`);console.log(result); // [7, 9]exec(code, options?) parses and evaluates the source, then returns one plain JavaScript value per top-level form. This example uses only the language: it filters a list without calling a host tool.
Arrival implements a subset of R7RS Scheme, with additional forms where R7RS leaves room for them. Unsupported forms such as set! and call/cc produce explanatory errors. The API is 0.x and can change.
Supply the operations
Section titled “Supply the operations”The interpreter includes its base language capabilities: R7RS forms, supported SRFIs, and polyglot packs. The capabilities option adds your operations to that base.
A host operation is declared in an EnvCapability, with a name, documentation, input and output types, and an implementation. The types govern how values cross between Scheme and JavaScript.
Host declares tools │ ▼Arrival evaluates Scheme tool call ↓ returned value computation ↓ argument next tool call │ ▼Host receives program resultsArrival supplies evaluation, not a tool permission policy. If an operation requires approval, your host must enforce it. In Harness, the daemon records and authorizes each tool request separately.
Host configuration can enter through typed define/overridable parameters. Register the overridable capability and pass values in config.params; the declared default is used when the host supplies no override. Embedding and capabilities covers host integration in more detail.
Keep bindings when you need them
Section titled “Keep bindings when you need them”A plain exec or execState call starts with a fresh scope. A define in one call therefore does not become available in the next.
For a conversation or REPL that should retain bindings, create one LexicalScope.fresh() and pass it as the scope option on successive calls. Scope lifetime is the host’s choice; Harness’s ordinary scheme_repl calls each use a fresh scope.
Set staticValidation: "on" to reject error-level diagnostics before evaluation. Its default is "off". Static validation cannot inspect bindings that a runtime (require …) will introduce.
Trace where values came from
Section titled “Trace where values came from”A host can opt into tracing with tap: new EvalTrace(), imported from @inhuman.tools/arrival/provenance. Traced values carry identifiers for the host calls they were derived from, and the trace lets you look up those calls.
This answers a concrete question: which tool results contributed to this value? It does not establish that those results were true. Without a trace tap, provenance reads as an empty list.
Run files from the command line
Section titled “Run files from the command line”Use the library when your application is the host. Use the CLI to evaluate a file, check source, or open a REPL:
npx @inhuman.tools/arrival-cli \ --help# Or install `arrival`:npm install -g \ @inhuman.tools/arrival-cliThe commands are arrival run <file.scm>, arrival check <file.scm> [...], and arrival repl. Their options are documented in packages/arrival-cli in the Arrival repository.
Isolation limits
Section titled “Isolation limits”The base language is designed without ambient filesystem, process, or network access. It also omits ports, a clock, random, and host globals such as process and require. The host supplies access through declared operations.
That design is not a security boundary. The 0.x interpreter’s README warns that sandbox escape is still feasible through property access and parts of the JavaScript–Scheme conversion layer.
Do not use Arrival in security-critical contexts or expose it to untrusted programs without additional isolation. The project advises containerization for deployment and warns against trusting the sandbox itself. Send isolation reports to security@here.build.
Keep expensive computation in host functions and use Scheme to compose operations. Benchmark your workload rather than assuming interpreted code will match native JavaScript performance.
Sources and license
Section titled “Sources and license”This page follows README.md, packages/arrival/README.md, and the evaluation API in packages/arrival/src/eval/generator-exec.ts in the Arrival repository. CLI behavior follows packages/arrival-cli/src/cli.ts. Package LICENSE.md files are authoritative; the interpreter is an MIT-licensed fork of LIPS.js.