5 ms·
I believe with a little (okay a lot of) motivation and a solid LLM, these can all be rewritten faster than everyone says. Especially if it’s gradual. Mozilla a
by ra1231963 1y ago
I believe with a little (okay a lot of) motivation and a solid LLM, these can all be rewritten faster than everyone says. Especially if it’s gradual.
Mozilla and Dropbox did it. LLMs are good at translating between languages, and writing unit tests to make sure things still work the same.
- flohofwoe 1y agoHow much Rust is actually in Firefox these days? The last numbers I see from 3 years ago is 10%.
- j16sdiz 1y ago> https://4e6.github.io/firefox-lang-stats/ https://4e6.github.io/firefox-lang-stats/ 12%. Assume the progress is linear (not logarithmic like most cases), we just need 60 more years to migrate those c/c++ code.
- ra1231963 1y agoThat was my point — with LLMs the progress would not be at the same slope as with people only.
- flohofwoe 1y agoHave there been any successful attempts yet of translating 'idiomatic' C++ to 'idiomatic' Rust for a large codebase that has been developed over 30 years? What does the output look like? Does the code look maintainable (because mechanical solutions to translate from other languages into Rust exist, the result is just not what a human would write or ever want to work on). Are the prompts to guide the LLM shorter than the actual code base to be translated? Etc etc... eg the idea to use LLMs for migration is quite 'obvious', but the devil must be in the details, otherwise everybody would be doing it by now.
- okanat 1y agoIdiomatic C++ allows too much "freestyle" and duck-typed code. Rust language basically doesn't support half of the things that C++ allows because there is no type or memory safe ways to achieve them. When translating things into Rust, borrow checker forces you to invert the logic or completely redo the architecture. Oftentimes it requires trying multiple things and evaluating the performance cost, generated machine code quality and interface flexibility. It is quite difficult without an actual person to translate things.
- flohofwoe 1y agoYeah that's why I'm very sceptical about any 'LLM will magically fix all the things' claims. The mechanical translations basically work by compiling the source language down to LLVM bitcode and then translating that back to another language, it works but is basically assembly code written in a highlevel language, it loses all 'semantics' and is entirely unmaintainable.
- ra1231963 1y agoHere are a few https://www.phoronix.com/news/Google-Linux-Binder-In-Rust https://www.phoronix.com/news/Google-Linux-Binder-In-Rust https://arxiv.org/abs/2503.23791v1 https://arxiv.org/abs/2503.23791v1 https://www.darpa.mil/research/programs/translating-all-c-to-rust https://www.darpa.mil/research/programs/translating-all-c-to... https://link.springer.com/content/pdf/10.1007/s10664-024-10573-2.pdf https://link.springer.com/content/pdf/10.1007/s10664-024-105... > Everybody would be doing it by now Models and agents have progressed significantly in the last few months. Migrating projects to rust can definitely be a thing in the coming years if there is sufficient motivation. But oftentimes c/c++ devs have aversions to the rust language itself, so the biggest challenge can be an issue of motivation in general.