The performance benefits of compiling something like Rust to Wasm are fairly well established, and generally unimpressive. However, I cannot find any information on the performance implications of using WAT to write WebAssembly by hand.
I want to make games with WebGPU, so there’s no DOM (beyond a canvas), and plenty of opportunities to isolate computationally expensive functions that do a ton of math.
I was hoping to use JavaScript for gluecode and WAT for hotcode, but I’m a little pessimistic about the performance. The alternative would be Swift and Metal (on macOS only).
Note: I’m working on an in-house grammar that compiles to JS, and an assembler for Wasm, which both support importing from each other, so the ergonomics of the languages are not an issue.
How fast is handwritten WebAssembly, compared to handwritten native assembly, all other things being equal?