Hacker News new | ask | show | jobs
by fyrn- 1649 days ago
Not back into C, from WASM to native executable / asm / object code
3 comments

Deukhoofd is correct — we compile the WASM code back into C in order to reuse and reduce friction with our existing compilation pipeline.
The solution described in the post actually translates C/C++ to WASM, and then translates the WASM bytecode back to C (via a tool called wasm2c), which is then fed back into the C compiler again to compile to native code, all 'offline' in the Firefox build process.
That was only for the prototype, the current implementation is:

source code -> WASM -> C -> native code