Hacker News new | ask | show | jobs
by protoster 758 days ago
Do typical emulators compile ahead of time? Just-in-time? If not, why? This approach (ahead of time compilation) appears to have huge benefits.
3 comments

You name the compilation and/or interpreter technique and there's at least one emulator that uses it.
A fair amount of 32-bit and later emulators do have JIT recompilation, but I'm not aware of any ahead-of-time translation unless that's how TeknoParrot works (you can run linux arcade games that use ELF binaries on windows with it for example), but I wouldn't call that emulation either way since the architecture is the same.
Modern Vintage Gamer over on Youtube has worked with Nightdive and Limited Run Games and helped design a C recompiler called Carbon Engine for various older consoles that are functionally the same as ahead of time compiled emulators.

https://youtu.be/eZRzaGFWoz8?si=XQyJol0pe2z2oG6d

There are lots of emulation methods but interpretation is probably(?) the most common or at least very common.

Interpretation involves writing a VM that represents the state of various parts of the machine, and executes instructions that change the state of the VM, with varying levels of accuracy.