3 ms·
Sometimes you may need to debug the actual wasm code or understand what the compiler is outputting. Depending on the flags you set during compilation, you may w
by chrisco255 3y ago
Sometimes you may need to debug the actual wasm code or understand what the compiler is outputting. Depending on the flags you set during compilation, you may want to optimize for size of binary or for performance. You may also want to compare the wasm produced by two different languages or different versions of the language compiler. Maybe you want to verify what libraries are actually getting bundled with your wasm.
- thamer 3y agoUnderstanding what the compiler outputs is also essential to debug the inevitable issues that come up when porting an existing program to WASM. Since it's a different platform with significant limitations, it's important to know how to replace some core APIs and capabilities and how to interface with these alternatives. By limitations I mean things that a POSIX program would expect that aren't generally available from WASM, like network programming, file system access, processes and threads, pipes and signals. Emscripten and WASI help to some extent, but the replacement APIs are rarely fully compatible.