The Free Software Foundation agreed this past weekend to allow C++ code into the Gnu Compiler Collection. Previously, the compiler was written predominantly in C code. While GCC has long been able to compile C++ source code into working binaries, the compiler itself has never before been modified or written in C++.
The announcement of this change in contribution policy by the FSF was made on the GCC mailing list. Mark Mitchell, chief sourcerer at CodeSourcery and major contributor to the project, wrote to it to explain the decision, saying that though C++ could now be used within GCC, this was no reason to simply recreate GCC in C++ for its own sake.
“Before we start to actually use C++, we need to determine a set of coding standards that will apply to the use of C++ within GCC,” he wrote.
“At first, I believe that we should keep the set of C++ features permitted small, in part so that GCC developers not familiar with C++ are not rapidly overwhelmed by a major change in the implementation language for the compiler itself. We can always use more of C++ later if it seems appropriate to do so then.”
The GCC project will have a lot of work ahead of it to determine these coding standards. Most of the developers of GCC have been working on the project in C for many years, ensuring a rather C-heavy skill set for the project’s community.
The GCC mailing list thread on the matter has sparked many ideas for how to include C++ code in GCC, and a great many ambiguities in how C++ is compiled were mentioned. Mitchell, on the other hand, brought the conversations back to a fundamental question: How can C++ make GCC better?
“I think we should focus on some user-visible deliverables (better optimization, faster compiler, new language feature, plugin API, whatever),” he said. “If converting something to use C++ helps achieve that goal, great. If it doesn’t, then why bother?”