News for hackers. Stuff that matters.
Re:Porting a NES Emulator from Go to Nim by shurcooL on Friday May 01, 2015 @03:39PM (#9474005)
Did you port from Go to Nim by hand, or was it automated in any way?

I thought that Go would be the last language I'd write by hand. Previously I wrote C++, which was a dead end in that I could never use tools to parse it and translate to a new language. But with Go it should be much easier to do that if/when I ever decide to switch to something else.

The performance of the emulator in browser (compiled via emscrimpten) is very impressive! It felt like solid 60 FPS to me. I wonder how the Go version compiled via GopherJS would compare? Have you tried?

Re:Porting a NES Emulator from Go to Nim by def- on Friday May 01, 2015 @03:42PM (#9474023)
I did it by hand, changing the code as I saw fit and learning as much about the NES as I could.

I haven't tried GopherJS, but I don't have much Go experience apart from reading it. On a related note, I read that porting the Go version to Android would be difficult and is still far in the future: https://github.com/fogleman/nes/issues/7

Re:Porting a NES Emulator from Go to Nim by conradev on Friday May 01, 2015 @05:13PM (#9474562)
There is also a NES emulator written entirely in JavaScript called jsnes[1] that would be interesting to compare to. The "solid 60 FPS" doesn't always translate to mobile. For example, jsnes runs fine on an iPhone 5S (64-bit processor), but stutters on an iPhone 5.

[1] https://fir.sh/projects/jsnes/

Re:Porting a NES Emulator from Go to Nim by Narishma on Friday May 01, 2015 @07:37PM (#9475199)
Forget about mobile, it runs at like 5 FPS on my Core i3 laptop.