Assembly Code conversion to Pythonista #118
Replies: 2 comments 1 reply
-
|
Hi Chris, My GitHub repository https://github.com/RichardPotthoff/ripoff is an example for using an LLM (Grok) to convert the Pythonista version of the program into a JavaScript version (Python->JavaScript). Grok did a pretty good job. It even added a sound synthesizer module to generate the sounds. The result is a single self-contained index.html file without any external dependencies. Here is the result: So the conversion works the other way around as well: You can develop a game in Pythonista, and then have an LLM turn it into a web application. Richard |
Beta Was this translation helpful? Give feedback.
-
|
@mmccthomas @RichardPotthoff Coming from a bit of a skeptics angle on AI generally. Is AI transforming the code as it has in the examples you’ve shown really that reliable? Personally the original or a disassembled source would probably always be my preference even in assembly. As my concern is that is there really any way to be sure and verify just how accurate it is without a painstaking line by line analysis? I suppose you could ask the AI but then you have the same question for the analysis it comes up with too. I have however actually been working on something adjacent to this very recently. Aiming at a much more direct approach to running assembly and also JavaScript directly from Pythonista, instead of converting it to Python. In a similar vein to my browser UI project (#113), I’ve been developing a runtime based on JavaScriptCore which can run WebAssembly and JavaScript in Pythonista directly. An ultimate aim of this being hopefully a full C cross compilation toolchain eventually. In theory it can support compiled python extensions in a similar way to how Pyto does it. Except completely in Python and iOS apis. I’m going to make a separate post when it’s more completed but this was just so relevant to my current thinking I thought I’d mention it too. It has a nearly complete JavaScript interop model at the moment. WebAssembly runs but has more integration work to do currently. Would love to hear your thoughts or whether this makes the AI’s job any easier even? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I’ve mentioned on here before about the ability of AI programs, particularly Claude and Gemini to create content for Pythonista.
A new ability has been shown recently, which is the ability to process assembly code and render into Pythonista.
An example was the prompt to Claude Sonnet 4.y via the chat interface (free version)
“Find an assembly code version of the classic space invaders online. Then try to covert it to Python using Pythonista for rendering.”
space_invaders.py
Apart from a small issue with scene.Color , missing the alpha channel, and trying to use Color class in setting background colour, the result was very credible.
In fairness, the documentation for Pythonista lists the alpha channel in Color as optional, but this isn’t true.
I believe that this transformation Assembler > Pythonista is a VERY interesting development in AI use, particularly for us oldies remembering old games and applications.
Chris
Beta Was this translation helpful? Give feedback.
All reactions