On 10/7/24 12:00 PM, Eli Zaretskii wrote:
From: Per Bothner <p...@bothner.com>
First, compared to C++ to Rust, moving from C to C++ is much more modest of
terms of
code changes as well as new skills needed.
That was maybe true 10 or 15 years ago, but is no longer true: C++ got
a lot of additional baggage, standard classes and libraries, and is
now very different from C. Converting a non-trivial C program to
efficient and easily maintainable C++ is a very large job, which
includes refactoring the main data structures and algorithms into the
equivalent C++ classes. Since you are advocating C++ due to its
safety, I'm sure you will agree that the entire memory allocation
strategy will have to be redesigned and reimplemented to achieve this
safety, otherwise why bother at all?
I think you're making the perfect be the enemy of the good. Converting
a large C codebase to "good, idiomatic" C++ is a large job.
But the point is you can do as much or little of such cleanup as you wish.
Once again, you can see this in action on the example of GDB, where
core parts of the code keep being redesigned and rewritten to this
day in significant ways. That's what conversion to C++ means in
practice, and there's no way around that.
Or you can take the lesson that you make the initial easy step of compiling
the C code with a C++ compiler, and then you can take your time cleaning up
things
depending on your painpoints, available people/time, and motivation.
I volunteer to change the Makefile etc and get the codebase compiling
with C++. This would likely include a bunch of 'extern "C"' declarations
are needed. But only if Patrice supports it (since he seems to do most work
on the texinfo-to-any part), *and* Gavin is at least neutral But as long as
Gavin is firmly opposed, I don't think there is much point in continuing the
discussion.
--
--Per Bothner
p...@bothner.com http://per.bothner.com/