News for hackers. Stuff that matters.
Re:Fergulator - NES emulator, written in Go by byuu on Tuesday April 16, 2013 @05:31PM (#5561043)
I have in the past written my CPU cores in a pseudo-language that allowed a custom preprocessor to spit out either a function call table or a switch table. (see bsnes v013 - v040 or so.)

It's not a significant difference. The margin of error is so slim that I couldn't confidently even say one ever outperformed the other.

The main difference is that, for about 512 instructions of 16-bit era complexity, the switch table binary will be about ~800KB smaller (obviously this is highly dependent on countless things. YMMV.)

Nowadays, I wrote a cooperative threading library. I am not sure how powerful a goroutine is, but my version allocates separate stacks so that each thread has its own nested call stack, and can exit even in subfunctions. It is indeed a major boon to writing clearer emulator code, to get rid of all that delicate state machine red tape. But it does come with a performance penalty in most cases.

Re:Fergulator - NES emulator, written in Go by tptacek on Tuesday April 16, 2013 @05:43PM (#5561105)
Goroutines have independent 4k stacks.