2 ms·
Webassembly execution chain
hey,
can someone explain the execution chain of a wasm file?
does it compile to native asm and then run? or does it emulate?
what happens if you try to execute wasm code inside the wasm code?
thanks!
- rijoja 10y agoWell it's not to complicated really. Just as you've stated it compiles to a subset of native asm. There's also a binary encoding, but that's basically dictionary compression of the source code with a fixed dictionary. I'm not sure what you mean with execute wasm code inside of wasm code? But I'll attempt to answer the question from my understanding of it. Webassembly is a subset of javascript, where the parts that cannot easily be optimized. Due to this support for eval is not included. So no it's not possible.
- tomcr 10y agoThanks for the reply! execute wasm code inside of wasm code - what i meant is: just in theory, if i compile a dynamic lang interrupter with JIT into wasm, will the generated asm code that JIT produce can run?