How do you rewrite C/C++ projects to Rust?
Posted by smokeeaasd 5 days ago
Comments
Comment by cdud3 8 hours ago
Comment by ale 8 hours ago
Honestly there should be a filter for these types of articles. I’m not going to bother reading something another person did not even bother writing.
Comment by pizza234 7 hours ago
Comment by hn_submit 5 hours ago
Comment by millerm 5 hours ago
Comment by faangguyindia 7 hours ago
memory usage dropped to half, execution speed is now 2x. Cross deployment is easy from silicon man to x64.
There are many low level optimizations available which i can exploit, compile is super fast for my project so development experience is better.
LOC dropped to half of the original.
Rust made life so much easier :)
Comment by hn_submit 5 hours ago
But I'm afraid managers will force engineers to put the generated code straight into production unaltered so they can claim their million dollar bonuses. And when things go South they'll call on those same engineers to fix things yesterday.
Comment by fukaiall 8 hours ago
2. Ignore any technical tradeoffs and considerations but solely lean on your guts and hypes on the Internet.
3. Ask Claude to rewrite the entire codebase to rust. Boom! Now you’re allowed to show off yourself on LinkedIn and HW as a super great rust engineer.
Comment by ivanjermakov 8 hours ago
Comment by zombot 8 hours ago
Comment by hn_submit 5 hours ago
Comment by reinhash 3 hours ago
Mostly the reasons are not of technical, but of political nature. I mean no one likes to be told that their language is "not good enough". Or "not safe enough". It is our instinct to defend what we love and have put so much time and effort into. But reality is, that Rust really helps eliminate whole classes of errors, that can happen even to the most experienced C or C++ devs.
Accepting that things will and should be rewritten in Rust - until an even better language comes along - is necessary. That does not mean that Rust needs to replace all code on earth. For sure there are many cases where it should not. But in the times of Fable and GPT 5.6, it becomes even more important to reduce any attack surface as much as possible.
Comment by himata4113 9 hours ago
Comment by imthias404 9 hours ago
Comment by pjmlp 8 hours ago
Comment by alex_suzuki 8 hours ago
Comment by forrestthewoods 9 hours ago
Step 2. Rewrite only the wrapper using already written tests.
Step 3. Get internet points because an LLM Rewrote it in Rust!
Comment by ramon156 8 hours ago
Next step can be to port it using e.g. tractor tooling and have a bunch of unsafe calls you need to implement. It's a really fun puzzle. The goal is to have no more cpp dependency
Comment by scaredginger 9 hours ago
Comment by namjh 9 hours ago