<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body style="overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;"><br id="lineBreakAtBeginningOfMessage"><div><br><blockquote type="cite"><div>On 9 Apr 2025, at 11:41, russ.gorby@gmail.com wrote:</div><br class="Apple-interchange-newline"><div><meta charset="UTF-8"><div class="WordSection1" style="page: WordSection1; caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 11px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><div style="margin: 0in; font-size: 12pt; font-family: Calibri, sans-serif;"><span style="font-size: 11pt;">I’ve heard that there is a desire to migrate the GnuCash code base to C++. This is something I was thinking of looking into but don’t want to put in the effort if this is not something that would be accepted by the gatekeepers.<o:p></o:p></span></div><div style="margin: 0in; font-size: 12pt; font-family: Calibri, sans-serif;"><span style="font-size: 11pt;"><o:p> </o:p></span></div><div style="margin: 0in; font-size: 12pt; font-family: Calibri, sans-serif;"><span style="font-size: 11pt;">I think the first step is to not refactor the code at all and just do the minimal required to use the C++ linker for linking the executables and to convert the cmake projects to use C++ compiler for all the (mostly C) code. Then once all the code is using the C++ compiler we can start to prioritize which portions of the code should be redesigned to be full-fledged object-oriented projects.<o:p></o:p></span></div><div style="margin: 0in; font-size: 12pt; font-family: Calibri, sans-serif;"><span style="font-size: 11pt;"><o:p> </o:p></span></div><div style="margin: 0in; font-size: 12pt; font-family: Calibri, sans-serif;"><span style="font-size: 11pt;">I think this is work I could do w/o impacting any of the real development going on but provide value down the road, but wanted to check-in first<o:p></o:p></span></div></div></div></blockquote><br></div><div>Russ,</div><div><br></div><div>It should be so easy.</div><div><br></div><div>We’ve been migrating code to C++ in bits and pieces for years. Mostly we convert a file to build with C++ then poke at the internals, replacing containers with STL ones, converting raw loops to STL algos, using lambdas and range-for and constexpr and so on. In a few cases we’ve done full-on rewrites with templates and std::variant and such. There’s still plenty of that sort of work to do, so dive in. Please start with a smallish peripheral-ish class (meaning one that not a lot of other code depends on) so you don’t lose too much time if you need to course-correct.</div><div><br></div><div>Be sure to read <a href="https://wiki.gnucash.org/wiki/C++">https://wiki.gnucash.org/wiki/C++</a> and <a href="https://wiki.gnucash.org/wiki/CodingStandard">https://wiki.gnucash.org/wiki/CodingStandard</a> before you start. Keep in mind that in nearly all cases the C++ must be wrapped in C access functions so that the C parts can call the C++ parts, and that no exceptions can escape the C++ boundary. Another thing that you need to be aware of is that most of libgnucash is also mapped to Guile/Scheme and large parts to Python using SWIG. So far we’ve only redone the SWIG bindings for the all-in C++ rewrites: As long as the C API remains then no SWIG changes are needed. The bindings live in the imaginatively-named `bindings` directory tree.</div><div><br></div><div>Not all of the C classes have good test coverage so you might want to start off writing some tests.</div><div><br></div><div>Are you familiar with the GObject type system?</div><div><br></div><div>Regards,</div><div>John Ralls</div><div><br></div><br></body></html>