Also, there is known story that Gates and Allen wrote BASIC compiler for some obscure microprocessor without having access to an actual thing, just paper spec. So they wrote emulator first, then compiler and guess what? when run on the real processor it worked like a charm from first try.