Skip to content

Add NightMonkey support. - #356

Open
cfallin wants to merge 1 commit into
bytecodealliance:mainfrom
cfallin:cfallin/nightmonkey
Open

cfallin wants to merge 1 commit into
bytecodealliance:mainfrom
cfallin:cfallin/nightmonkey

Conversation

@cfallin

@cfallin cfallin commented Sep 23, 2026

Copy link
Copy Markdown
Member

NightMonkey is an ahead-of-time JS-to-Wasm compiler built on top of SpiderMonkey.

This PR adds a --nightmonkey CLI flag that selects the NightMonkey variant of the engine, and invokes the NightMonkey compiler (which is a native binary) on a snapshotted image to AOT-compile JS bytecode into Wasm bytecode.

Because the NightMonkey compiler itself is a native program, this PR incorporates binaries for four platforms (Linux/x86-64, Linux/aarch64, Windows/x86-64, macOS/aarch64) and bundles them all into the monolithic NPM package, adding ~25MiB. If we instead want to split out per-platform sub-packages and dynamically download them as needed, I am happy to do that instead.

Depends on bytecodealliance/StarlingMonkey#323 and bytecodealliance/nightmonkey#1.

@andreiltd

Copy link
Copy Markdown
Member

Hey @cfallin, just a heads-up, the fix for the CI has just been merged so you can try to rebase and see if it resolves failures in this PR.

@cfallin

cfallin commented Nov 24, 2026

Copy link
Copy Markdown
Member Author

Working on updating this now that NightMonkey + StarlingMonkey integration have landed. Needs bytecodealliance/nightmonkey#7 (and then a version-hash bump in StarlingMonkey to pull it in), then I'll push my update here.

@cfallin
cfallin force-pushed the cfallin/nightmonkey branch from a3b8541 to b8cb546 Compare November 24, 2026 19:01
NightMonkey is an ahead-of-time JS-to-Wasm compiler built on top of
SpiderMonkey.

This PR adds a `--nightmonkey` CLI flag that selects the NightMonkey
variant of the engine, and invokes the NightMonkey compiler (which is a
native binary) on a snapshotted image to AOT-compile JS bytecode into
Wasm bytecode.

Because the NightMonkey compiler itself is a native program, this PR
incorporates binaries for four platforms (Linux/x86-64, Linux/aarch64,
Windows/x86-64, macOS/aarch64) and bundles them all into the monolithic
NPM package, adding ~25MiB. If we instead want to split out per-platform
sub-packages and dynamically download them as needed, I am happy to do
that instead.
@cfallin
cfallin force-pushed the cfallin/nightmonkey branch from cd255be to dafa0c9 Compare November 24, 2026 19:03
@cfallin

cfallin commented Nov 24, 2026

Copy link
Copy Markdown
Member Author

Looks like nightmonkey tests are passing in CI -- @andreiltd or @tschneidereit this should be ready for review now!

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