2 ms·
> JavaScript cannot be compiled to WebAssembly Wait, what? Why? Is WASM not Turing-complete?
by lisper 4y ago
> JavaScript cannot be compiled to WebAssembly
Wait, what? Why? Is WASM not Turing-complete?
- AndrewDucker 4y agoIt would need a JavaScript interpreter to go with it.
- goatlover 4y agoYou need a runtime like the browser or Node in WebAssembly. I suppose you could write one in Rust and then compile it to wasm. But then what do you gain by doing this?
- sunfish 4y agoWasm is Turing-complete. What people typically mean by this is that in a browser context, compiling JS to Wasm does not currently make it run faster than just running the JS as JS. Javascript can be compiled to WebAssembly, and there are people doing it: https://bytecodealliance.org/articles/making-javascript-run-fast-on-webassembly https://bytecodealliance.org/articles/making-javascript-run-...