Skip to content

Implement Hemlock WASM execution path with TS interpreter fallback#2

Open
nbeerbower wants to merge 1 commit into
mainfrom
claude/finish-this-rabx68
Open

Implement Hemlock WASM execution path with TS interpreter fallback#2
nbeerbower wants to merge 1 commit into
mainfrom
claude/finish-this-rabx68

Conversation

@nbeerbower

Copy link
Copy Markdown
Contributor

Completes the architecture promised in the README: blocks now execute
through the Hemlock WASM interpreter when the binary is present.

  • Add hemlock-codegen: emits standalone Hemlock scripts per event
    handler from compiled BlockAction trees, plus a prelude defining
    print/create/destroy helpers and variable-name collection
  • Add HemlockRunner: compiles handler scripts at game start, then per
    run serializes instance state into the context, executes via
    hemlock_run_script, and reads mutated state, output, and instance
    creations back
  • Wire the engine to route handler dispatch through the runner, with
    all-or-nothing fallback to the built-in TS interpreter when the
    binary is absent or any script fails to compile
  • Harden the bridge: non-throwing tryLoadHemlock() probe (handles the
    dev server's SPA fallback), runtime-dynamic import so Vite/Rollup
    no longer try to resolve /wasm/hemlock.js at build time
  • fetch-wasm: support GITHUB_TOKEN auth to avoid rate limits; drop
    unused import
  • Update README to describe the implemented execution path

https://claude.ai/code/session_01AhnuhNAb1MueTczkkupims

Completes the architecture promised in the README: blocks now execute
through the Hemlock WASM interpreter when the binary is present.

- Add hemlock-codegen: emits standalone Hemlock scripts per event
  handler from compiled BlockAction trees, plus a prelude defining
  print/create/destroy helpers and variable-name collection
- Add HemlockRunner: compiles handler scripts at game start, then per
  run serializes instance state into the context, executes via
  hemlock_run_script, and reads mutated state, output, and instance
  creations back
- Wire the engine to route handler dispatch through the runner, with
  all-or-nothing fallback to the built-in TS interpreter when the
  binary is absent or any script fails to compile
- Harden the bridge: non-throwing tryLoadHemlock() probe (handles the
  dev server's SPA fallback), runtime-dynamic import so Vite/Rollup
  no longer try to resolve /wasm/hemlock.js at build time
- fetch-wasm: support GITHUB_TOKEN auth to avoid rate limits; drop
  unused import
- Update README to describe the implemented execution path

https://claude.ai/code/session_01AhnuhNAb1MueTczkkupims
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.

2 participants