Skip to content

Implement typed async generators - #310

Merged
ctate merged 1 commit into
mainfrom
codex/async-generators
Sep 14, 2026
Merged

ctate merged 1 commit into
mainfrom
codex/async-generators

Conversation

@ctate

@ctate ctate commented Sep 14, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • implement typed async generator declarations, generic instantiations, function expressions, object methods, public class methods, and private methods
  • add the queued next / return / throw request protocol with Node-compatible eager starts, promise settlement ordering, exception rejection, finally behavior, and reference-counted ownership
  • lower for await over typed async generators and support the node:timers/promises setInterval(delay, value) async iterator
  • emit the protocol through both C and LLVM, including WASI switched-coroutine support, and regenerate the compatibility/docs artifacts

Closes #170.

Validation

  • pnpm -r build
  • changed-file ESLint with --quiet
  • pnpm node-compat:check
  • docs NEXT_DIST_DIR=.next-check pnpm check
  • TypeScript 7 adapter/order suites, with the 5.9.3 order baseline re-recorded for new corpus fixtures
  • focused C and LLVM differential runs in plain and ASan/RC-audit modes
  • wasm32-wasi runs for the async-generator protocol and timers/promises interval fixtures
  • rebuilt and verified @scriptc/runtime-darwin-arm64
  • pnpm test:sandbox: all plain and sanitized Linux Sandbox shards plus local Darwin/cross-target contracts passed; cold managed-image gate completed in 12.2 minutes

Deliberate boundaries

Async yield*, arbitrary structural async-iterator objects, and timers/promises.setInterval AbortSignal options remain explicitly fenced. The implemented delegation spelling is an explicit for await loop. Library-mode generator exports retain their existing refusal.

Coordination

This touches the scheduler/runtime, IR, and emitter files also modified by #288. The features are orthogonal, but whichever PR lands second will need a focused rebase around those shared seams.

@vercel

vercel Bot commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
scriptc Ready Ready Preview, v0 Sep 14, 2026 5:34am UTC

@ctate
ctate merged commit a8a5204 into main Sep 14, 2026
20 checks passed
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.

Async generator support

1 participant