Allocation paths ask the collector for a freed slot rather than handing
it the object, so every allocation no longer builds its object in
memory first, and a reused slot's placeholder is replaced without drop
code. The heap's mark state is held inline, and the strings' collector
state is made only once a run passes its first threshold, so a short
run allocates nothing for the collector.
Replace the incremental-update barrier and its atomic finish with a
snapshot-at-the-beginning barrier: the first write to an object while
marking traces it before the write, cell writes shade the value they
overwrite, objects made while marking are black, and marking ends when
nothing is grey, with no rescan of the roots.
Count marking work in slots and trace long properties, elements and
entries a chunk at a time. Pay for no idle allocations at a cycle's
start, set the next threshold from the data live when marking ended,
and share the room between the arenas so the threshold holds.
The crate becomes the Rust implementation of the reference's language layer (`src/language/`): its public API is
the Rust form of `Language` (`Runtime::make` with `globals(run)`, modules, limits and translation; `HostFunction`
for `Host.fn` with sync, async and sync-thenable types, idempotent, constructible and takes-functions;
`DurableFunction`; `Namespace`; `Failure` for `Host.fail` and `Host.missing`; `Run` with its metadata; programs,
suspend and resume; snapshots). Code Mode (tools, schemas, the catalog, `search`, OpenAPI, hooks, max tool calls,
extensions) is removed, and the language files move from `src/language/` to `src/`.
Host calls follow the reference's language runtime: arguments cross under the runtime's translation (functions and
promises fail the call unless dropped or awaited), a function from a result crosses back only to a function that
takes functions, async and durable calls start at the next handover, sync work can block (`Returned::Block`) or
stay pending (`Returned::Pending`), and a suspend is refused while a call that can't be detached runs. Namespace
paths carry their root label, and their `keys` may fail. Snapshots save the run's metadata and its calls by global
path, and restart them by resolving that path again.
The replays define the generators' host globals (`conformance/reference.rs` shares `tools` with
`conformance/reference.ts`): the cases, `host.json`, `boundary.json` and `streaming.json`. `tests/host.rs` mirrors
the reference's `test/language.test.ts`; the API tests are ported, and the Code Mode tests are removed.
Programs in frames/core.ts record, with message and location, unsupported syntax that
runs or is never reached (classes, with, debugger, new.target, import.meta, super,
nested exports), the bindings it hides, using declarations, nested imports, names
located inside parentheses, and parse errors in acorn's words; a suspension reaches
unsupported syntax after resuming. New cases record values around it, and the api
test checks the suggestion, which the recordings do not capture. streaming.json is
to be regenerated at integration.
The reference parses with acorn and reports its message, ending with a period and
the hint "Code must be plain JavaScript written as a program body.", at acorn's
position. oxc words most errors differently and sometimes points elsewhere (the
first of two declarations, the end of the previous token, the keyword instead of
the token after it), so its diagnostics are translated to acorn's wording and
position, with the AST deciding what text cannot (a binding or an assignment of
eval, a duplicate parameter, super() inside a method). Regular expression literal
errors take acorn's reasons, its offset after the opening slash and the pattern
without flags. An import or export below the top level, which acorn accepts in a
script, is no longer a parse error, and empty code reads "Code cannot be empty."
A var declared only inside a with body is not bound, since the reference never
compiles that body, so the name reads the global. A using or await using
declaration is a const that nothing disposes. An import below the top level does
nothing in the program and throws its SyntaxError where it runs in a function. A
read of, or write to, a name fails at the name itself, so a parenthesized
assignment target is located where the reference locates it. ThrowSyntax now
throws a plain SyntaxError and ThrowUnsupported the unsupported-syntax one.