Skip to content

refactor: simplify and harden runtime internals - #70

Merged
andreiltd merged 1 commit into
mainfrom
refactor-runtime
Jul 25, 2026
Merged

andreiltd merged 1 commit into
mainfrom
refactor-runtime

Conversation

@andreiltd

Copy link
Copy Markdown
Owner
  • consolidate WIT dispatch and import metadata
  • tighten buffer, stream, and tagged value handling
  • centralize runtime selection and build variants
  • make quickjs context state unwind-safe

- consolidate WIT dispatch and import metadata
- tighten buffer, stream, and tagged value handling
- centralize runtime selection and build variants
- make quickjs context state unwind-safe
@andreiltd
andreiltd merged commit 65741c5 into main Jul 25, 2026
5 checks passed
@andreiltd
andreiltd deleted the refactor-runtime branch July 25, 2026 15:33
@github-actions github-actions Bot mentioned this pull request Jul 25, 2026
malformed-c added a commit to apsis-io/dwarf that referenced this pull request Sep 2, 2026
The tidying half of the refactor, taken where it applies: `evaluated`
becomes a plain `Cell<bool>` (this runtime is single-threaded, so the
atomic bought nothing), the Node binding uses the new
`Runtime::builtin(sync, opt_size)` rather than matching two bools, and
`wit_imports` sheds helpers nothing calls any more.

Three places kept dwarf's side, for reasons rather than convenience:

  - `interpreter.rs` is the big one. #70 PREDATES #76 and #77, so taking
    its rewrite of `export_call` would have silently undone the resource
    receiver fix and async resource members, both landed minutes ago. The
    refactor there is a rewrite to re-apply both onto, not a merge.
  - `TaskState::is_active` and `JsState::module_loader_available` are
    dwarf's own, and documented; upstream's hunk only removed them
    because upstream does not have them.
  - The CLI's minify block: upstream independently found the same bug
    dwarf fixed today - a partial AST accepted after a parse error - and
    fixed it in the same place it already lived. dwarf's now sits in
    dwarf-core, after the TypeScript transform, which is the ordering the
    CLI-side version cannot express. Their regression test is taken,
    adapted to dwarf's flag and wording.

Upstream: andreiltd/componentize-qjs#70

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant