Hello everyone!
I'm currently writing a VM to Jack decompiler. It's in a work in progress rn.
https://github.com/YasseenRamadan2005/Jack-Decompiler/
Write now it mostly works, but you need to severely edit the decomp output because
1. It assumes that ~=, >= and <= are valid, but they only work for my custom compiler, not the provided one
2. Completely ignores types.
3. Pretty sure I messed up something when generating a[b] expression, because in Jack a cannot be an expression.
Regardless, it generates a good base line (get's you like 80% there). From then one it's up to you to put in the rest of the work.
I'll keep hammering away.
https://github.com/YasseenRamadan2005/Jack-Decompiler/tree/main/MY_OS
this contains the generated VM from my Compiler. jack_source is the decomp output no edit
https://github.com/YasseenRamadan2005/Jack-Decompiler/tree/main/HACK_OS
the Vm files are the provided HACK OS VM files. jack_source is the decomp output no edit.
https://github.com/YasseenRamadan2005/Jack-Decompiler/tree/main/HACK_OS/manual%20laborThis is as far as I got to recreate the provided OS's Jack files. Output.jack is currently broken.
https://github.com/YasseenRamadan2005/Jack-Decompiler/tree/main/Chess is the VM files from
https://github.com/AndrewRShort/chess-vm-files
plus the Hack OS VM files. I haven't touched anything in the decomp output.
Right now, I'd say I'm around 60% done with the project. If there's any questions, I'll be happy to answer the best I can.
My decompiler uses a lot of code from my compiler, specifically how I group VM instructions. More on that here
https://yasseenramadan2005.github.io/nand2tetris/2025/06/28/Optimzed-VM-Translator.html