WATaBoy: JIT-Ing Game Boy Instructions to WASM Beats a Native Interpreter(humphri.es)
225 points by energeticbark 1 day ago | 36 comments
tl;dr: A student built WATaBoy, a Game Boy emulator that JIT-compiles SM83 instructions to WebAssembly bytecode, relying on the browser's JS engine to further compile the Wasm to native machine code—a workaround for iOS's JIT restrictions. Benchmarks show the JIT-to-Wasm approach runs ~1.2x faster than a native interpreter and ~1.5x faster than a Wasm interpreter, with Safari outperforming Chrome and Firefox. The post also walks through Wasm codegen, linking, and indirect dispatch from Rust, and argues this technique could enable faster cross-platform emulation if codegen tooling matures.
HN Discussion:
  • Impressive undergraduate project and clever workaround for iOS JIT restrictions
  • Sharing related prior work or similar JIT/recompilation experiences
  • ~The performance comparison is unsurprising given interpreter overhead, but the JIT runtime itself is cool
  • The author's motivation is flawed because iOS JIT workarounds already exist
  • Curiosity about extensions like iOS benchmarks or native wasm execution