TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Porting a NES Emulator from Go to Nim

158 点作者 def-大约 10 年前

10 条评论

fogleman大约 10 年前
&gt; As I really liked fogleman&#x27;s NES emulator in Go I ended up mostly porting it to Nim. The source code is so clean that it&#x27;s often easier to understand the internals of the NES by reading the source code than by reading documentation about it.<p>Win!
评论 #9475598 未加载
haberman大约 10 年前
Let me get this straight. We have an emulator for 1985 hardware that was written in a pretty new language (Go), ported to a language that isn&#x27;t even 1.0 (Nim), compiled to C, then compiled to JavaScript? And the damn thing actually <i>works</i>? That&#x27;s kind of amazing.
评论 #9475517 未加载
评论 #9474555 未加载
评论 #9474296 未加载
评论 #9474090 未加载
allendoerfer大约 10 年前
This title covers the essence of hacker news pretty well.
评论 #9474824 未加载
shurcooL大约 10 年前
Did you port from Go to Nim by hand, or was it automated in any way?<p>I thought that Go would be the last language I&#x27;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&#x2F;when I ever decide to switch to something else.<p>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?
评论 #9474023 未加载
评论 #9474562 未加载
warmwaffles大约 10 年前
Well this is new. I&#x27;ve never seen Nim before. What does it offer that Rust, Haskell, Erlang, etc... do not?
评论 #9473931 未加载
评论 #9474119 未加载
评论 #9473922 未加载
评论 #9474307 未加载
mwcampbell大约 10 年前
The binary size difference is quite striking. Linux distro packagers are going to like Nim, I think.
评论 #9474053 未加载
beagle3大约 10 年前
Ubercool.<p>Question about nim: from looking at <a href="https:&#x2F;&#x2F;github.com&#x2F;def-&#x2F;nimes&#x2F;blob&#x2F;master&#x2F;src&#x2F;nes&#x2F;cpu.nim" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;def-&#x2F;nimes&#x2F;blob&#x2F;master&#x2F;src&#x2F;nes&#x2F;cpu.nim</a> , I wonder: is there way to give the no. of cycles and instruction encoding with the &quot;op&quot; template, so those 256 byte arrays get built automatically?
评论 #9476767 未加载
评论 #9476585 未加载
lqdc13大约 10 年前
Any plans to do let people call Nim functions from Python with Python standard objects like strings&#x2F;dicts&#x2F;lists as arguments? This would let people write the fast parts in Nim and slow parts in Python.
评论 #9476221 未加载
评论 #9476172 未加载
评论 #9494201 未加载
mhd大约 10 年前
I&#x27;m quite impressed about the small amount of code required for a NES emulator. I thought they&#x27;d have to do all kinds of special casing for cartridge-specific stuff…
评论 #9474515 未加载
评论 #9475714 未加载
doomrobo大约 10 年前
For anyone who was wondering what I was: porting from libSDL calls to drawing on an html canvas is done automatically by emscripten