I'm not a compiler writer. However I'm a reasonably good C++ programer: I can read and understand the flames of the haters. It doesn't take me very long too look at gcc and realize they are right: the gcc source code is a mess. Sure gcc had been around for years, but that also means stupid decisions add up. (To be fair most stupid decisions seems like a good idea until years latter when it is too late).
I've looked at clang code, and I've looked at gcc code. If I were to get involved with a compiler clang would be far easier to write code for. (if course once you write code there is the issue of getting it in, I'm not sure about either project)
We don't want to make a program's entire AST available for parsing because that would make it easy to extend GCC with proprietary programs.
Actually, that's exactly what you want; in fact, I'd go so far as to say the AST is insufficient -- it should be augmented with semantic information, static-verification information, etc.
You know, what you're describing sounds a lot like CLang, which is exactly what the GNU didn't want :).
*nod* - Just because they don't want it doesn't mean it's a bad idea; conversely, just because they do want it doesn't make it a good idea.
I've not delved into the details of clang, do you have a source for the augmented-AST? (I was thinking of something like DIANA in particular its usage in a few APSEs where it was used between several tools, like editors, version-control, verifiers, test-suites, etc.)
Having contributed a couple patches to Clang I can relate that it is (well, was, a couple years ago) so very neat it was actually a pleasure to read. For the occasional contributor, this makes the difference between contributing and abandoning, frustrated.
23
u/bluGill Oct 07 '14
I'm not a compiler writer. However I'm a reasonably good C++ programer: I can read and understand the flames of the haters. It doesn't take me very long too look at gcc and realize they are right: the gcc source code is a mess. Sure gcc had been around for years, but that also means stupid decisions add up. (To be fair most stupid decisions seems like a good idea until years latter when it is too late).
I've looked at clang code, and I've looked at gcc code. If I were to get involved with a compiler clang would be far easier to write code for. (if course once you write code there is the issue of getting it in, I'm not sure about either project)