3 ms·
I wrote a GBC emulator in Haskell (https://github.com/CLowcay/hgbc/tree/master https://github.com/CLowcay/hgbc/tree/master). It's nice for modelling the instru
by cwslowcay 1y ago
I wrote a GBC emulator in Haskell (https://github.com/CLowcay/hgbc/tree/master https://github.com/CLowcay/hgbc/tree/master). It's nice for modelling the instruction set, decoding and dispatching instructions. Optimization is tough though. To achieve playable performance, everything has to go into the IO monad. Haskell is famous for lazy evaluation. I found that occasionally useful, but mostly a source of performance problems.
Ultimately, the hard thing in emulation was not decoding instructions. It was synchronization, timing, and faithfully reproducing all the hardware glitches (because many games will not work without certain hardware bugs). Haskell doesn't help much for those things. If I was doing another emulation project I'd choose rust.