News for hackers. Stuff that matters.
Re:C/C++ vs. Rust Performance by krizhanovsky on Sunday November 01, 2020 @01:44PM (#24961488)
Well, we didn't mention this in the article, but this is very practical actually. About 10 years ago we had a request significant reworking an open source DNS server and the main problem with the project was that almost whole logic was placed in about 10 functions and most of the functions exceeded 1000 LoC. Each code update involved plenty of headache with dynamic memory freeing. We spent about 1-2 days to compile it with C++ and replace the most crucial pointers with smart pointers, that we didn't have to care about memory freeing. That time we had to make the job done ASAP, surely we should have spend time in proper code refactoring.

Surely you need to modify C code to compile it with C++ and in the article we made an example of the modification. But the point is that the changes are pretty straightforward and small.

Re:C/C++ vs. Rust Performance by the_mitsuhiko on Sunday November 01, 2020 @02:36PM (#24961883)
I wouldn’t want to be tasked with maintaining a C++ codebase like that. That sounds horrible.
Re:C/C++ vs. Rust Performance by krizhanovsky on Sunday November 01, 2020 @01:46PM (#24961499)
Also if you don't like my example with quick fix of some dirty project, then consider InnoDB storage engine which was developed in pure C for 2 decades, but now it's C++.