News for hackers. Stuff that matters.
Re:Fergulator - NES emulator, written in Go by tptacek on Tuesday April 16, 2013 @02:46PM (#5559997)
There is a general form to switch statements in Go that really is syntactic sugar over if/else chains.

I get that serious emulators invest effort in making dispatch fast, and that a naive for/switch loop is not the fastest way to dispatch instructions, but it's nice for getting the emulator working. :)

Re:Fergulator - NES emulator, written in Go by daeken on Tuesday April 16, 2013 @03:06PM (#5560124)
> I get that serious emulators invest effort in making dispatch fast, and that a naive for/switch loop is not the fastest way to dispatch instructions

If you're the kind of masochist that enjoys optimizing dispatch loops (hi, you're not alone), check this out: http://www.emulators.com/docs/nx25_nostradamus.htm One of the best resources out there for this sort of stuff.

Re:Fergulator - NES emulator, written in Go by asb on Tuesday April 16, 2013 @03:13PM (#5560163)
Thanks, I hadn't seen that before. My go-to point for all this stuff has always been the papers by Ertl and others http://www.complang.tuwien.ac.at/forth/threaded-code.html