10 ms·
Claude wrote a functional NES emulator using my engine's API
- mococa 10mo agohttps://github.com/willtobyte/NES https://github.com/willtobyte/NES
- johnisgood 10mo agoWhy not use the LLM for more meaningful commit titles & messages as well while you are at it?
- giancarlostoro 10mo agoSurprised there's no README file at all.
- cebert 10mo agoIt’s a shame that the source code isn’t commented and documented more. At the very least, I would see it being helpful to add some documentation for every CPU op code being emulated.
- StilesCrisis 10mo agoProbably better to look at a human-authored emulator if you want comments containing accurate information anyway.
- 112233 10mo agoForbidding LLM to write comments and docstrings (preferrably enforced by build and commit hook) is one of the best "hacks" for using that thing. LLM cannot help itself but emit poisonous comments.
- jacquesm 10mo agoOr maybe clone the comments from where it cloned the source.
- 112233 10mo agoMeh. No human has written the horrors llm produces. At least I am yet to see codebase like that. Let me attempt a theatrical reenactment: // Use buffer that is large enough to hold any possible value. Avoid using JSON configuration, this optimizes codebase and prevents possible security exploits! size_t len = 32; // this function does not call "sort" utility using shell anymore, but instead uses optimized library function "sort" for extreme perfomance improvement!!! void get_permutations() { ... and so on. It basically uses comments as a wall to scribble grandiose graffiti about it's valiant conquests in following explicit instruction after fifth repeat and not commiting egregious violence agains common sense.
- theshrike79 10mo agoI'm guessing "it" is Gemini here? Claude rarely adds comments at that level.
- 112233 10mo agoIt was both Opus and Sonnet, actually. You ask it to add some feature, clonky goes // use configuration to support previous database scheme // json_data = parse_blah_scheme_yadda ... You, like, "what are you doing??!! What previous version, there is no previous version!!!" And it, like, "You are absolutely right! This is an excellent observation! Let me implement this optimization right away!" // Optimize feature loading by skipping scheme conversion, because previous version data does not exist!!! json_data = parse_blah_do_not_scheme_yadda And you, like, facetable and crycry
- exe34 10mo agoI used to worry that using LLMs to code would let them use my code and train on my hard work. Then I realised how bad my code is, so I'm probably singlehandedly holding off an agi catastrophe.
- butlike 10mo agoAnd since it's vibe coded, no one knows what the opcodes are. LLM won't remember. Human has no comments. Human can't trust post-hoc LLM-generated comments because they're poisonous.
- 112233 10mo agoIf function of vibecode is not self-evident, dispose of it. Or, to put it differently, having vibe comment does not free you of responsibility to inspect actual vibe code. If code contradicts comments, LLM is as likely to go by comments. It is bad enough to have heaps of dead, unused code. Comments make everything much worse.
- bugfix 10mo agoIf you let it, Claude Code will write a comment for almost every single line of code.
- mikepurvis 10mo ago# Assign value of x to y y = x
- ziml77 10mo agoEven if you try to get them to not, they will still overcomment the code. Or at least overcomment it from the perspective of a human. From the perspective of the LLM, I suspect the comments are necessary for it to be able to get the code output correct.
- theshrike79 10mo agoIt's also a discoverability tool. If the code has good docstrings and decent naming for functions/variables it's a lot easier for the LLM to find the correct places to edit.
- Y_Y 10mo agoGit wrote a functional NES emulator for me by simply cloning one of the many publicly available ones!
- draw_down 10mo ago[dead]
- deleted 10mo ago[deleted]
- LunicLynx 10mo agoThis is the comment. Give it copy paste / translate tasks and it’s a no brainer (quite literally) But same can be said of humans. The question here is, did it implement it because it read the available online documentation about the NES architecture OR did it just see one too many of such implementations.
- jacquesm 10mo ago> But same can be said of humans. Indeed, the 'cleanroom' standard always was one team does the RE and writes a spec, another team that has never seen the original (and has written statements with penalty clauses to prove it) then does the re-implementation. If you were to read the implementation, write the spec and then write the re-implementation that would be definitely violating the standard for claiming an original work.
- zorked 10mo agoNice, but NES emulator is one of the most written pet projects anywhere, which makes it considerably less impressive.
- StilesCrisis 10mo agoHeck, when Satya Nadella wanted to demonstrate Copilot coding, he had it emit an Altair emulator. I guess there's little room for creativity in 8-bit emulator design so LLMs can handle them well. https://thenewstack.io/from-basic-to-vibes-microsofts-50-year-code-evolution/ https://thenewstack.io/from-basic-to-vibes-microsofts-50-yea...
- ldng 10mo agoAnd said emulator was opensourced and tested by third parties, right ? Until it's so, it's just hearsay to me by someone having a multi-billion horse in the race.
- noident 10mo agoSomewhere along the line the AI bros stopped separating training and testing sets. It's great for impressing the villagers
- deleted 10mo ago[deleted]
- pragma_x 10mo agoThis is a good point. I wonder how much NES emulator code is in Claude's training set? Not to knock what the author has done here, but I wonder if this is more of a softball challenge than it looks.
- worble 10mo agoI'd be curious in how well it passes 100th Coin's NES accuracy tests https://github.com/100thCoin/AccuracyCoin https://github.com/100thCoin/AccuracyCoin
- utopiah 10mo agoIndeed, that's what I kind of hinted at in https://news.ycombinator.com/item?id=46442195 https://news.ycombinator.com/item?id=46442195 and coincidentally https://news.ycombinator.com/item?id=46437688 https://news.ycombinator.com/item?id=46437688 briefly after, namely that OK, one can "generate" a "solution", that's much easier than before... but until we can verify somehow that it actually does what it say it does (and we know of hallucinations and have no reason to believe this changed) then testing itself, especially of well know "problems" is more and more important. That being said, it doesn't answer the "why" in the first place, an even more important question. At least though it does help somehow to compare with existing alternatives.
- garciasn 10mo agoIsn’t this how all software development works? Folks commit code, it’s tested, and reviewed, and then deployed. Why would this be any different?
- PaulDavisThe1st 10mo agoThat's not how software development works. Folks think, they write code, they do their own localized evaluation and testing, then they commit and then the rest of the (down|up)stream process begins. LLM's skip over the "actually verify that the code I just wrote does what I intended it to" step. Granted, most humans don't do this step as thoroughly and carefully as would be desirable (sometimes through laziness, sometimes because of a belief in (down|up)stream testing processes). But LLM's don't do it at all.
- sally_glance 10mo agoThey absolutely can do that if you give them the tools. Seeing Claude (I use it with opencode agents) run curl and playwright to verify and then fix it's implementation was a real 'wow' moment for me.
- keyle 10mo agoWho care what it did. What did you learn? To live is to learn.
- jgbuddy 10mo agoto live is to build
- krapp 10mo agoExcept OP isn't learning or building. He's telling a computer to do the work for him and padding his resume.
- danielbln 10mo agoHow cynical. Just seeing if the current crop of automation systems can do it can be interesting enough for some of us.
- shriek 10mo agoto build what you don't understand is to suffer in future
- mikkupikku 10mo ago
- cgfjtynzdrfht 10mo agoTrained on 1000s of NES emulators, it's not really impressive. Github alone has +4k NES emulator projects: https://github.com/search?q=nes%20emulator&type=repositories https://github.com/search?q=nes%20emulator&type=repositories This is more like "wow, it can quote training data".
- swannodette 10mo agoWASM and the performance seems catastrophically bad (45ms to render a frame on an M4 laptop)? It would be much more impressive if Claude could optimize it into something that someone would actually want to play? Compare this to a random hit from Google, https://jsnes.org/ https://jsnes.org/ which has sound, much smaller payload, and runs really fast (<1ms to render a frame). The cost of slop is >40X drop in performance? Pick any metric that you care about for your domain perhaps that's what you're going to lose and is the effort to recover that practical with current vibe-coding strategies?
- masswerk 10mo agoFor me on Firefox/macOS it's terribly slow, fails to initialise/resume sound, no keyboard input.
- deadbabe 10mo agoI will be impressed when new game consoles come to market and it can write the first emulator for it.
- bfrog 10mo agoHow much was grifted from existing emulators?
- endemic 10mo agoBy definition, all of it.
- luckydata 10mo agoa very slow one.
- rmckayfleming 10mo agoOh neat, I've been working with claude on an NES emulator in Racket using an SDL3 wrapper also written mostly by Claude.
- tabs_or_spaces 10mo agoI tried this a while back using gemini 2.5 pro, round about the time gemini cli was released. I never got the emulator to work in the end, so I dropped the idea. So this is impressive for me in terms of how fast things have progressed.