Implement Hemlock WASM execution path with TS interpreter fallback#2
Open
nbeerbower wants to merge 1 commit into
Open
Implement Hemlock WASM execution path with TS interpreter fallback#2nbeerbower wants to merge 1 commit into
nbeerbower wants to merge 1 commit into
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Completes the architecture promised in the README: blocks now execute
through the Hemlock WASM interpreter when the binary is present.
handler from compiled BlockAction trees, plus a prelude defining
print/create/destroy helpers and variable-name collection
run serializes instance state into the context, executes via
hemlock_run_script, and reads mutated state, output, and instance
creations back
all-or-nothing fallback to the built-in TS interpreter when the
binary is absent or any script fails to compile
dev server's SPA fallback), runtime-dynamic import so Vite/Rollup
no longer try to resolve /wasm/hemlock.js at build time
unused import
https://claude.ai/code/session_01AhnuhNAb1MueTczkkupims