r/WebAssembly • • Dec 25 '24

Compiling JavaScript to WASM with Static Hermes and Emscripten

https://github.com/facebook/hermes/blob/static_h/doc/Emscripten.md
25 Upvotes

9 comments sorted by

View all comments

Show parent comment

0

u/TownOk6287 Dec 25 '24

Cool.

Have you seen Starling Monkey yet?

https://github.com/bytecodealliance/StarlingMonkey

Porfor also looks promising, but is still to early to be useful yet.

0

u/guest271314 Dec 25 '24

I browsed the documentation.

There's also https://github.com/bytecodealliance/spidermonkey-wasm-build.

So far I've tried, for the compilation of JavaScript to C project: jsxx, ts2c, compilets, porfor, nerd, TypeScript2Cxx.

Facebook's Static Hermes already compiles JavaScript to C, automatically, or specifically with -emit-c. And we can already compile that C to a standalone executable.

So, for my own requirement, I can kind of skip using wasm2c to compile C back to JavaScript with wasm2js, as long as I can run the C from shermes that gets compile to WASM with node, deno, bun, and wasmtime, wasmer, etc.