Live data from Hacker News

WATaBoy: JIT-Ing Game Boy Instructions to WASM Beats a Native Interpreter

humphri.es

41–45 of 45 posts

Re: WATaBoy: JIT-Ing Game Boy Instructions to WASM Beats a Native Interpreter

#41

Still doesn't beat a natively-coded emulator. I got several that run faster on a 166MHz non-MMX Pentium than this emulator does on my Core Ultra i9.

On Mednafen I can speed up the emulator up to 4x while compiling c++ under an n270 netbook. With GCC, not Clang. Without compiling I might yield 16x speeds and more with ease.

Re: WATaBoy: JIT-Ing Game Boy Instructions to WASM Beats a Native Interpreter

#42

The absolutely easiest way to write a JIT is to use Javascript and eval() (or "new Function()", which is just eval in a Java-shaped tuxedo). You can quite easily speed up little matching functions, especially arithmetic heavy ones, by just filling in some templates at runtime! Here's an example used in PuzzleScript: https://github.com/increpare/PuzzleScript/blob/dc1e0fc979365...

This is true, and is why I think Javascript is underrated for emulation. For example, this PSX emulator: https://github.com/kootstra-rene/enge-js It has decent compatibility and good speed. Furthermore, I challenge anyone to find a PSX emulator with fewer lines of code with competitive speed and accuracy. To my knowledge, this is by far the simplest such implementation, and is able to do this by taking advantage of J…

> To my knowledge, this is by far the simplest such implementation

Are you taking into account the complexity of v8?

Re: WATaBoy: JIT-Ing Game Boy Instructions to WASM Beats a Native Interpreter

#43
post #42

Earlier quoted context omitted.

This is true, and is why I think Javascript is underrated for emulation. For example, this PSX emulator: https://github.com/kootstra-rene/enge-js It has decent compatibility and good speed. Furthermore, I challenge anyone to find a PSX emulator with fewer lines of code with competitive speed and accuracy. To my knowledge, this is by far the simplest such implementation, and is able to do this by taking advantage of J…

> To my knowledge, this is by far the simplest such implementation Are you taking into account the complexity of v8?

No I do not, in the same way that I would not take into account the complexity of the Python interpreter for Python emulator projects or the compiler for C or Rust projects. I would also not take into account the complexity of Retroarch for libretro-based emulator cores, because all of the actual challenging parts that effectively document the console still remain.

These are general-purpose tool chains. The real question is, using those tools, how easily can you make an emulator for a device with as much complexity as the PSX?

Re: WATaBoy: JIT-Ing Game Boy Instructions to WASM Beats a Native Interpreter

#44
post #42

Earlier quoted context omitted.

> To my knowledge, this is by far the simplest such implementation Are you taking into account the complexity of v8?

No I do not, in the same way that I would not take into account the complexity of the Python interpreter for Python emulator projects or the compiler for C or Rust projects. I would also not take into account the complexity of Retroarch for libretro-based emulator cores, because all of the actual challenging parts that effectively document the console still remain. These are general-purpose tool chains. The real ques…

> in the same way that I would not take into account the complexity of the Python interpreter for Python emulator projects or the compiler for C or Rust projects.

I'm less inclined to care about compile dependencies, but I think it's absolutely worth caring about how heavy of runtime dependencies you're pulling into your project.

Re: WATaBoy: JIT-Ing Game Boy Instructions to WASM Beats a Native Interpreter

#45

Earlier quoted context omitted.

Good thing I'm not running games on my 4gb Pentium 4 then.

Your code running on other people’s hardware is a privilege. Treat it with respect.

No it’s not. It’s just not. If someone doesn’t like what I wrote they can hack it, ignore it, or vibe code up an alternative for their Xerox Alto for all I care.

Privilege has nothing to do with it, nor does respect. Wtf.

Post reply on HN