An update on the SMB Decompilation to Kotlin proje...
# feed
j
An update on the SMB Decompilation to Kotlin project: I decided I'm tired of translating a lot of these obvious functions and decided I wanted to make a full 6502 decompiler. I recently picked up Claude and decided to test it on this project. It came up with a 41 pass (no joke) plan for decompiling. I let it vibe. Unsurprisingly, it didn't work. Not even close. However, that won't stop me from actually making the decompiler. The repo in progress (including the old Claude written code) can be found here: https://github.com/UnknownJoe796/6502-to-kotlin The hope is that with modifications, the output will be able to be run on a computer just fine, and from there I'll be able to clean up the code and improve its organization.
s
I feel a blog article coming up… "My journey trying every coding agent in existence to get the port done for me." Can’t wait for your verdict 😄
For my paid work, I actually use coding agents rarely. They are more something I experiment with in my personal projects. Maybe it’s because those projects are smaller and easier for AI to handle, or perhaps because it’s not a big deal if something goes wrong there.
j
Lol, yeah every AI I've tried working with has taught me a lot about how to use them. Every time I get access to a new one I always want to see if it can do the job better (despite knowing in the back of my mind that they're not all that different). I will give Claude Code credit for being what feels like comparitively determined to finish whatever you ask. Most systems time-out pretty quick and use shortcuts to "finish", but Claude did that a lot less. That's what initially gave me hope it might be able to handle a lot of work unsupervised. Clearly, it did not.
I ate credits making the 41 passes for sure
s
Interesting. So Claude is cheating a lot less? I hate AI always removes / manipulates assert-statements to make unit tests pass - sometimes even if you told them not to.
j
At least, on the surface it did. The first 15 or so passes actually worked OK, but later on it lost track of the available results from the other passes and then started shortcutting it.
s
I even needed to tell Firebender to execute the code and make sure there are no compile errors before it tells me that it's done. That was included in Junie's system prompt. I hope they add it, too.
j
Hah, I had that happen exactly once over my time with Claude, and I still have no idea why. It usually ended with either a find/replace problem it felt it just couldn't handle or fully complete passing tests. Not that those tests were ever as valueable as one would hope. I directed it to make "demonstration tests" which output sections of SMB to demonstrate its work. That helped, I think.
s
AI works best if you write the unit tests first and let it complete the tests. The tests can be done partly manually or generated from original sources - I do both things. Then decline every AI operation that also changes the tests (while told not to). You either run out of tokens or have working (and sometimes ugly) code in the end.
j
Yep, this experiment was to see if I could not hand-hold it, as I ran it in the background while I did all of my Saturday cleaning and researching other topics. I hoped that this might work especially since this is a heavily well-known CS topic with lots of prior work.
c
I've been working on a NES emulator for a few months now (in Rust, not Kotlin) and I'm wondering how this project will deal with IRQs and mappers, which are integral to how the NES works...
j
Oh, that's really simple. It won't. The point is to get the majority of the code (i.e. Game logic) over to Kotlin and then you manually finish the rest.
c
Makes sense