compiler-explorer / compiler-explorer/compiler-explorer
[REQUEST] Web Assembly JIT compiler
- Dominant language
- TypeScript
- Stars
- 19.1k
- Forks
- 2.1k
- Avg merge
- 3d 15h
- Merged PRs (30d)
- 67
Description
It is possible to get native jitted code for web assembly(wasm) out of javascript engines like SpiderMonkey and V8. [Here](https://mbebenita.github.io/WasmExplorer/) is an example.
I think it makes sense to add wat(wasm text)-to-x86 explorer in the future to study optimization opportunities. One could use CE to generate [wat](https://godbolt.org/z/fcrCwC) and then copy-paste that wat in the second window and get native assembly.
One way to get native assembly is to run v8 with --print-wasm-code option. There's also a way using v8's internals to get custom output.
Adding that would involve installing wasm tools for (wat -> wasm) conversion and one of the javasctipt engines. I personally tried using v8 and it wasn't difficult in terms of installing/compiling from source compared to llvm/clang. Although that would also involve pulling some google internal tools like depot_tools.
Thanks,
Anton
Contributor guide
Assessment
This issue has not been assessed yet.