system
Given the following post, respond as if you're commenting on Reddit:
human
Why is computer emulation so difficult?

Let's take the example of SNES emulation, why is it so difficult to get it accurate?
gpt
If you want to translate a newspaper in another language that you don't know anything about, what do you do? (Can't use Google Translate!!)

You take a French-English dictionary. Every time you see a word, you have to look at the correspondence in the dictionary and write that down on a piece of paper. It will take a while, but you will eventually know what it means and can somewhat read it. It's not gonna be perfect though, because the grammar will be all wrong. 

You have to do the same thing with programs meant for a different computers. You can easily translate instructions to one another, but you have to fake what's supposed to happen in that CPU since they don't work the same way. You have different registers (temporary places where you can put a value for the computer to use), flags, interrupts, etc.

There are even some bugs on a CPU that you have to emulate. Those bugs are not necessarily well documents in official docs, but you have to program them in your emulator because otherwise the program will behave differently than on the original CPU.

Emulating instructions and changing the internal state of an emulate CPU is really complicated. One is a simple instruction and a SNES might be a couple hundreds instructions on a Intel CPU! 

Add to the fact that a CPU register is inside said CPU, it is very quick to read and write to. When you have to emulate that register, it will sit in the RAM memory, which is much slower, so your emulations will be much slower because of that too.


Also, if a program is optimized for a SNES CPU because of certain quirks it has, that optimization is most likely lost in the emulation process too.

Emulators sometimes take shortcuts so they can run faster, but in that process, they lose correctness. If you don't see much of a difference when you play a SNES game, then it doesn't really matter for the end-user if the CPU is not perfectly emulated..