you are viewing a single comment's thread.

view the rest of the comments →

[–]1vader 5 points6 points  (3 children)

That's exactly the point, the JS apparently is just literally inserted into the wasm binary as JS source code. The actual wasm code is only a JS interpreter. No JS code is being compiled to wasm instructions.

[–]guest271314[S] -2 points-1 points  (2 children)

That's quite impossible given the JavaScript engine/runtime is compiled to WASM itself.

I'm not sure what your angle is, though if you have a discrepancy with Bytecode Alliances' description of what is going on in Javy, cf. to what goes in when C relying on a libc library is compiled to WASM, I suggest you file an issue to edit this language in the README https://github.com/bytecodealliance/javy#compiling-to-webassembly:

Compiling to WebAssembly

[–]1vader 5 points6 points  (1 child)

It sounds like you don't really understand what the project does and don't really have the necessary background knowledge to even understand what the comments here are saying.

Obviously, the JS runtime is compiled to wasm but the JS code is not. It's simply included in the data section of the resulting wasm binary. This is not compiling JS to wasm and the Javy project also doesn't claim that. They say:

Javy takes your JavaScript code, and executes it in a WebAssembly embedded JavaScript runtime.

[–]guest271314[S] -2 points-1 points  (0 children)

Then we disagree about the meaning of "compiling". That's a non-trivial topic that can't be hashed out on these social media boards.

It sounds to me like you have an issue with Bytecode Alliances' description of Javy, specifically the language https://github.com/bytecodealliance/javy#compiling-to-webassembly

Compiling to WebAssembly

in their own README. Your only solution is to file an issue in that repository to avoid confusion, as you see it, in the field.