Re:WebAssembly Interface Types: Interoperate with All the Th...
by icebraining on Wednesday August 21, 2019 @03:06PM
(#20760476)
If you're distributing an executable (not a library), you can just AOT compile the generated wasm to machine code.
For example, the WasmExplorer already lets you compile C++ -> wasm -> x86 assembly: https://mbebenita.github.io/WasmExplorer/?state=%7B%22option...
Re:WebAssembly Interface Types: Interoperate with All the Th...
by the8472 on Wednesday August 21, 2019 @03:40PM
(#20760850)
I doubt you get the same performance as direct compilation. LLVM ir carries lots of annotations useful to optimizing passes, e.g. aliasing information.
Re:WebAssembly Interface Types: Interoperate with All the Th...
by sunfish on Wednesday August 21, 2019 @03:54PM
(#20761007)
The twist is, you can produce wasm from LLVM, including running the full mid-level optimizer first, which is the part of LLVM where those annotations and aliasing information are most valuable.
That stuff only works if you limit yourself to exclusively run in a wasm runtime. If you want to compile to any other platform you still need C glue code.