| Ive done this sort of thing using deepseek flash swarms for just a few bucks. The key thing is that each project needs its own swarm script. you cant just tell the bot "pls port this to rust". you need to analyze the architecture, build a proper plan of how the translation will go, and then iterate your execution script to launch hundreds of bots to do the various stages of the translation. And you need to iterate these stages to make sure it all works. So, for example, i ported stb_image from C to Jai (you can think of Jai as similar to Zig, another c-style lang). To do that, i built my own agent scheduling/swarm system, because there is nothing out there that works, its all slop.
First i used normal claudecode and the likes to build a set of translation rules, documentation about the project, and set up the context for all.
Then the first stage of the swarm was to use claude to split the 7000 line library into chunks of about 500 lines each, a few functions/structs at a time. Then each deepseek bot had a task of translating that snippet of code from C to Jai.
Next, i had a system merge it all back together. This was done with just a single claudecode running over time. It had to be agentic and not a script because the bots often would duplicate definitions and things like that. Then, i had a system where it would try to compile the project, get an error list, parse the error list, and split that error list across multiple fixer agents. Doing multiple fixers because Jai can give you a large error list across a bunch of functions, so this speeds it up. If your project rules/setup/etc is better you can improve this step to have less errors to begin with. The more tools you can have to prevent errors instantly on a feedback loop of each sub-task, the better it goes. After the fixer step, the code was ported, but with some mistakes. I ran a wide pass of having 2 agents look at each struct/function, and validate if the translation was done well. 2 of them because if both agree the function is fine, the function probably is actually fine. Next, i began iterating the test suite. The library had a decent enough test suite, so splitting the work between testing + fixing tests across the different parts of the library was doable. for example i would run fixes on png format and jpeg format at once couse their code doesnt overlap. After the tests were 100% green, the next stage was to implement a literal exploit finding swarm to fuzz it all, which actually found a couple errors on the original library and found a bunch of more obscure bugs in the port. After that, now i have my own version of this image loading library, more hardened than the original, on a pet lenguage i wanted to do it for. Here is the result https://github.com/vblanco20-1/stb_image_jai Note that the better the AI you have, the less error the process has, and the larger chunking you can use. Mythos can likely do this same port much easier, but deepseek flash did it in about 3 bucks of tokens including the trial runs and experiments. I later use this tooling to build a translator agent swarm for my videogame that can do english to anything translation for 7000 strings that can be menu buttons, tooltips, small fluff text, and others. |