11

Are there any tools (yet) which can compile a wasm module to a native executable (eg. an ELF or .exe file)? Something like emscripten but in reverse. Failing that, is there any other way to run webassembly outside of a browser?

compor
  • 2,239
  • 1
  • 19
  • 29
Shum
  • 1,236
  • 9
  • 22
  • 2
    Possible duplicate of [Is tooling available to 'assemble' WebAssembly to x86-64 native code?](https://stackoverflow.com/questions/52111076/is-tooling-available-to-assemble-webassembly-to-x86-64-native-code) – ColinE Sep 09 '18 at 13:54
  • 1
    That's mostly the same question. Though I really want a tool that can output an executable, not just show me the machine code on a website. – Shum Sep 10 '18 at 07:37

1 Answers1

12

There is a wabt tool called wasm2c which can convert your wasm module to C. This can then be compiled to native code: https://github.com/WebAssembly/wabt/tree/master/wasm2c

sbc100
  • 2,619
  • 14
  • 11