Announcement

Collapse
No announcement yet.

GCC Can Now Be Worked On In C++

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • GCC Can Now Be Worked On In C++

    Phoronix: GCC Can Now Be Worked On In C++

    The Free Software Foundation and GCC Steering Committee have now decided that it's okay and permitted to write code for the GNU Compiler Collection (GCC) within C++. Up to this point, C has been the preferred language for working on GCC...

    http://www.phoronix.com/vr.php?view=ODMwMw

  • #2
    That's good news. I imagine this might get them some new contributions from C++ devs.

    Comment


    • #3
      Originally posted by RealNC View Post
      That's good news. I imagine this might get them some new contributions from C++ devs.
      From the looks of things, I doubt it. According to the mailing list email, they seem to want to disallow many features of object oriented programming in contributed code, which is the wrong way of doing things.

      Comment


      • #4
        Ah, I only hope that LLVM, Clang and friends get the same level features/speed as gcc, so we can stop depending on gcc.

        But any way, competition is always good.

        Comment


        • #5
          Originally posted by Shining Arcanine View Post
          From the looks of things, I doubt it. According to the mailing list email, they seem to want to disallow many features of object oriented programming in contributed code, which is the wrong way of doing things.
          The only actual object-oriented feature I see mentioned is multiple inheritance, which is not exactly universally accepted even among OO programmers (Java and C# deliberately omitted it in favor of single inheritance + interfaces, for example).

          Comment


          • #6
            Originally posted by Shining Arcanine View Post
            From the looks of things, I doubt it. According to the mailing list email, they seem to want to disallow many features of object oriented programming in contributed code, which is the wrong way of doing things.
            I think you misunderstand their intent. They're changing the rules to allow C++, but since not all existing developers are C++ experts, they're not going to immediately "anything goes" for those developers who are. So, to start with, they're allowing basic classes and the STL, but not allowing more confusing features like multiple inheritance or templates. Entirely sensible, as far as I'm concerned.

            Or look at it a different way - the developers already have standards on the code they accept, and anything they find overly complicated is going to get shot down pretty quickly - whether it's because the code was badly written, or because it uses advanced language features that the reviewers aren't experts in. A coding standard like the one proposed merely identifies up-front the subset of C++ which they're prepared to accept, to avoid wasting contributor's time.

            Comment


            • #7
              Originally posted by KDesk View Post
              Ah, I only hope that LLVM, Clang and friends get the same level features/speed as gcc, so we can stop depending on gcc.

              But any way, competition is always good.

              Yeah I wonder if the decision to allow C++ in the GCC code is a consequence of them feeling the "heat" from the LLVM/Clang crowd.

              LLVM/Clang is moving along VERY nicely and with recent self-hosting capabilities and their new libc++ they are quite free to get ported and used independently of GCC.
              The ClangBSD project seems to move along nicely and work is underway to get the Linux kernel compiled with clang.

              Competition is good indeed. I look forward to a couple of interesting years ahead.

              Comment


              • #8
                Hu? C++ in a C compiler? Are gcc devs high on drugs?

                Comment


                • #9
                  I hope it will be in a part after the first bootstrap, so that GCC can still be compiled by a C compiler....

                  Comment


                  • #10
                    here comes the pain

                    Comment


                    • #11
                      Originally posted by sylware View Post
                      Hu? C++ in a C compiler? Are gcc devs high on drugs?
                      GCC has for a very long time now supported multiple languages and hardly specific to C anymore. To be misinformed AND insulting is hardly a good combination. Even assuming that GCC is only a C compiler, there is nothing wrong with writing it in a different language if there is a benefit to doing so. It is entirely up to the developers to decide what the efficient method is.

                      Comment


                      • #12
                        Great, now GCC will take even longer to compile.

                        Comment


                        • #13
                          Originally posted by RahulSundaram View Post
                          GCC has for a very long time now supported multiple languages and hardly specific to C anymore.
                          Yes, we all know it's Gnu Compiler Collection, not Gnu C Compiler.
                          As long as it will forever be possible to compile the C compiler without having the C++ compiler part of GCC, everyone should be rather happy...
                          (just like it'd be a nice thing that you could fully compile a C++ compiler without ever having a C compiler in GCC; I don't know whether it's possible now, someone who knows could pong back)

                          Comment


                          • #14
                            Originally posted by sylware View Post
                            Hu? C++ in a C compiler? Are gcc devs high on drugs?
                            GCC - Gnu Compiler Collection

                            Does not only compile c-code, so your saying is moot.

                            Comment


                            • #15
                              Originally posted by Ex-Cyber View Post
                              The only actual object-oriented feature I see mentioned is multiple inheritance, which is not exactly universally accepted even among OO programmers (Java and C# deliberately omitted it in favor of single inheritance + interfaces, for example).
                              They also mention templates. As far single inheritance + interfaces, that is a castrated form of multiple inheritance. In that capacity, all but one class from which a base class inherits must be abstract. It is a way of dealing with name-space collisions, although not a particularly good way and it is still a form of multiple inheritance.

                              Originally posted by RahulSundaram View Post
                              GCC has for a very long time now supported multiple languages and hardly specific to C anymore. To be misinformed AND insulting is hardly a good combination. Even assuming that GCC is only a C compiler, there is nothing wrong with writing it in a different language if there is a benefit to doing so. It is entirely up to the developers to decide what the efficient method is.
                              C++ was originally called C with Classes. It is a dialect of C and its features directly translate into things in C. The objects are just structures with function pointers and corresponding function pointer tables. Classes are just collections of functions that take objects as their first parameters. Templates and function overloading are just short hand notations for functions that would have been given different names in C. All of the features of encapsulation, and the ways in which it can be broken, which includes friend functions, are just a form of structure that a programmer would have enforced on his own anyway, assuming he was writing good code.

                              From a fundamental perspective, C++ is nothing more than a shorthand notation for C. The only aspect in which they differ is in exception handling, which is something that was tacked onto C++, is entirely optional and is often not used. Good programmers never had a need for exception handling anyway.

                              Comment

                              Working...
                              X