GCC is re-implementing in C++ and C discarded

Discussion in 'C Programming' started by lovecreatesbeauty, Aug 22, 2012.

  1. Hello! Wise people!


    Just read the shock news[1][2] that GCC is re-implementing in C++ and C will be discarded ( deprecated ? : )

    But still not very clear on it.

    .. does it mean C++ is better than C?

    .. the re-implemention involves which one(s): C compiler, C++ compiler, and Java, Fortran ..?

    .. what will the man who said "C++ is horrible language" and his related linux project do?


    -vvvv-

    This page is meant to eventually help document the ongoing effort in the "gcc-in-cxx" branch to make gcc compile in C++ mode, i.e. as C++ source code.

    So, the goal of this branch is to facilitate switching GCC's implementation language to C++.

    -^^^^-

    [1] http://gcc.gnu.org/wiki/gcc-in-cxx
    [2] http://gcc.gnu.org/wiki/cxx-conversion
     
    lovecreatesbeauty, Aug 22, 2012
    #1
    1. Advertising

  2. Am 22.08.2012 19:34, schrieb lovecreatesbeauty:
    > Hello! Wise people!
    >
    >
    > Just read the shock news[1][2] that GCC is re-implementing in C++ and C will be discarded ( deprecated ? : )
    >
    > But still not very clear on it.
    >
    > . does it mean C++ is better than C?


    It means "use the right tool for the right job." What is "better"
    depends on your metric. In my experience, designing large and
    complicated projects in C alone is harder than to do it in C++ where you
    have better ability to check for correctness of your constructions, and
    a more expressive language to get the job done. If your goal is to
    develop lean software on smaller systems, C is the better choice as its
    overhead is smaller and its usually better supported on processors off
    the mainstream.

    > . the re-implemention involves which one(s): C compiler, C++ compiler, and Java, Fortran ..?


    I don't know. Probably all of them one after another. Note that gcc has
    a common code generator that will, likely, be in C++ for all those cases.

    > . what will the man who said "C++ is horrible language" and his related linux project do?


    Who the **** cares? Linux requires a lot of arcane magic as far as the
    linkage and loading process is concerned, and critically depends on some
    of the internals how that goes for the gcc. It would be harder to keep
    this magic working for C++.

    Greetings,
    Thomas
     
    Thomas Richter, Aug 22, 2012
    #2
    1. Advertising

  3. lovecreatesbeauty

    Guest

    On Wednesday, August 22, 2012 7:34:37 PM UTC+2, lovecreatesbeauty wrote:
    > Hello! Wise people!
    >
    > Just read the shock news[1][2] that GCC is re-implementing in C++ and C will be discarded ( deprecated ? : )
    >
    > But still not very clear on it.
    >


    It just means that gcc will be entirely written in C++ instead of C.
    Is it a good move? Ask the gcc developers!
    More on, one can think that it will be harder to build gcc (as it's easier to find C compilers than C++ compilers on different architectures), but to build gcc you need another gcc anyway, cross-compiling it on a different machine if needed.
    So, IMHO, nothing to see here.
    Ciao!
     
    , Aug 22, 2012
    #3
  4. lovecreatesbeauty

    James Kuyper Guest

    On 08/22/2012 01:34 PM, lovecreatesbeauty wrote:
    > Hello! Wise people!
    >
    >
    > Just read the shock news[1][2] that GCC is re-implementing in C++ and C will be discarded ( deprecated ? : )
    >
    > But still not very clear on it.
    >
    > . does it mean C++ is better than C?


    No, it means the developers of gcc think it's a better language for that
    application. They might have a different opinion for other kinds of
    applications. Their opinion might or might not be correct.

    > . the re-implemention involves which one(s): C compiler, C++ compiler, and Java, Fortran ..?


    gcc is the Gnu Compiler Collection; that implies to me that the correct
    answer is likely to be "all of the above (and others too)".

    > . what will the man who said "C++ is horrible language" and his related linux project do?


    He'll probably say that gcc has made a horrible mistake. He might or
    might not be correct. Keep in mind that people who go to extremes in
    support or opposition to a given language are seldom reliable judges of
    such issues.
     
    James Kuyper, Aug 22, 2012
    #4
  5. lovecreatesbeauty

    Angel Guest

    On 2012-08-22, James Kuyper <> wrote:
    > On 08/22/2012 01:34 PM, lovecreatesbeauty wrote:
    >> Hello! Wise people!
    >>
    >>
    >> Just read the shock news[1][2] that GCC is re-implementing in C++ and C
    >> will be discarded ( deprecated ? : )
    >>
    >> But still not very clear on it.
    >>
    >> . does it mean C++ is better than C?

    >
    > No, it means the developers of gcc think it's a better language for that
    > application. They might have a different opinion for other kinds of
    > applications. Their opinion might or might not be correct.
    >
    >> . the re-implemention involves which one(s): C compiler, C++ compiler,
    >> and Java, Fortran ..?

    >
    > gcc is the Gnu Compiler Collection; that implies to me that the correct
    > answer is likely to be "all of the above (and others too)".
    >
    >> . what will the man who said "C++ is horrible language" and his related
    >> linux project do?

    >
    > He'll probably say that gcc has made a horrible mistake. He might or
    > might not be correct. Keep in mind that people who go to extremes in
    > support or opposition to a given language are seldom reliable judges of
    > such issues.


    Nice diplomatic answer. I fear it will be wasted on the thread starter
    though, this guy is so obviously trolling it's not even funny.


    --
    "C provides a programmer with more than enough rope to hang himself.
    C++ provides a firing squad, blindfold and last cigarette."
    - seen in comp.lang.c
     
    Angel, Aug 22, 2012
    #5
  6. lovecreatesbeauty <> writes:
    > Just read the shock news[1][2] that GCC is re-implementing in C++ and
    > C will be discarded ( deprecated ? : )

    [...]

    As far as I know, the only thing changing is the implementation
    language. It has nothing to do with the languages that gcc
    can compile, and there is no indication of C being discarded or
    deprecated other than as the implementation language for gcc itself.

    I have no comment on whether this is a good idea, but it's not what
    you're implying it is.

    --
    Keith Thompson (The_Other_Keith) <http://www.ghoti.net/~kst>
    Will write code for food.
    "We must do something. This is something. Therefore, we must do this."
    -- Antony Jay and Jonathan Lynn, "Yes Minister"
     
    Keith Thompson, Aug 22, 2012
    #6
  7. בת×ריך ×™×•× ×¨×‘×™×¢×™, 22 ב×וגוסט 2012 20:08:08 UTC+1, מ×ת Keith Thompson:
    > lovecreatesbeauty <> writes:
    >
    > I have no comment on whether this is a good idea, but it's not what
    > you're implying it is.
    >
    >

    When any major program moves from C to another language it's something of a
    disappointment to regs of this newgroup. Particularly when it's the compiler
    in which a lot of C programs themselves are compiled.
    But it's an outlier. The general trend is that C++ use is down, C use is
    holding up.
     
    Malcolm McLean, Aug 22, 2012
    #7
  8. lovecreatesbeauty

    BartC Guest

    "Malcolm McLean" <> wrote in message
    news:...
    > בת×ריך ×™×•× ×¨×‘×™×¢×™, 22 ב×וגוסט 2012 20:08:08 UTC+1, מ×ת Keith Thompson:
    >> lovecreatesbeauty <> writes:
    >>
    >> I have no comment on whether this is a good idea, but it's not what
    >> you're implying it is.
    >>
    >>

    > When any major program moves from C to another language it's something of
    > a
    > disappointment to regs of this newgroup. Particularly when it's the
    > compiler
    > in which a lot of C programs themselves are compiled.
    > But it's an outlier. The general trend is that C++ use is down, C use is
    > holding up.


    It's no surprise that there might be better languages for implementing
    compilers with than C. Especially with much faster hardware now that allows
    more productive languages to be used.

    But I wouldn't have chosen C++..

    --
    Bartc
     
    BartC, Aug 22, 2012
    #8
  9. On 22/08/2012 21:45, BartC wrote:

    [..]
    >
    > It's no surprise that there might be better languages for implementing
    > compilers with than C. Especially with much faster hardware now that
    > allows more productive languages to be used.
    >
    > But I wouldn't have chosen C++..
    >


    Don't forget that GCC itself is a set of programs that need to run
    "reasonably fast". It would take very long to compile the QT libraries
    if GCC was implemented in any scripting language. C++ seems to offer
    the best compromise between abstractions and performance.

    --
    Vincenzo Mercuri
     
    Vincenzo Mercuri, Aug 22, 2012
    #9
  10. On 22/08/2012 18:34, lovecreatesbeauty wrote:
    > Hello! Wise people!
    >
    >
    > Just read the shock news[1][2] that GCC is re-implementing in C++ and C will be discarded ( deprecated ? : )
    >
    > But still not very clear on it.
    >
    > . does it mean C++ is better than C?


    C and C++ both have their place (and I indeed use each depending on the
    problem needing to be solved)

    The hidden question is "How much does the GCC source code look like C",
    to which the answer is "not really".

    The internal code has vast quantities of macros which appear to
    implement OO design; so much so that the equivalent C++ code in places
    is substantially cleaner and neater.

    So the movement is more from "Basically C++ but implemented with the
    preprocessor" to C++, which is rather less of a leap.

    >
    > . the re-implemention involves which one(s): C compiler, C++ compiler, and Java, Fortran ..?
    >
    > . what will the man who said "C++ is horrible language" and his related linux project do?


    Continue to be the same because, while he is particularly vocal in his
    opinion, he is correct when it comes to a kernel.

    C++ is substantially easier than C for making sensible looking which
    cripples performance. Two examples would be virtual functions inside a
    tight loop (causing slower execution), or a liberal sprinkling of
    templates (causing a swelling of code size). This is not saying that it
    cant be done, but that it is making an already hard problem far harder.

    ~Andrew

    >
    >
    > -vvvv-
    >
    > This page is meant to eventually help document the ongoing effort in the "gcc-in-cxx" branch to make gcc compile in C++ mode, i.e. as C++ source code.
    >
    > So, the goal of this branch is to facilitate switching GCC's implementation language to C++.
    >
    > -^^^^-
    >
    > [1] http://gcc.gnu.org/wiki/gcc-in-cxx
    > [2] http://gcc.gnu.org/wiki/cxx-conversion
    >
     
    Andrew Cooper, Aug 22, 2012
    #10
  11. "BartC" <> writes:
    > "Malcolm McLean" <> wrote in message
    > news:...
    >> בת×ריך ×™×•× ×¨×‘×™×¢×™, 22 ב×וגוסט 2012 20:08:08 UTC+1, מ×ת Keith Thompson:
    >>> lovecreatesbeauty <> writes:
    >>>
    >>> I have no comment on whether this is a good idea, but it's not what
    >>> you're implying it is.
    >>>

    >> When any major program moves from C to another language it's
    >> something of a disappointment to regs of this newgroup. Particularly
    >> when it's the compiler in which a lot of C programs themselves are
    >> compiled. But it's an outlier. The general trend is that C++ use is
    >> down, C use is holding up.

    >
    > It's no surprise that there might be better languages for implementing
    > compilers with than C. Especially with much faster hardware now that
    > allows more productive languages to be used.
    >
    > But I wouldn't have chosen C++..


    Before the transition, gcc consisted of thousands of lines of C.
    Translating all that code to a language without very close compatibility
    with C would have been a huge task.

    As I understand it, much of gcc was already written in the common subset
    of C and C++.

    --
    Keith Thompson (The_Other_Keith) <http://www.ghoti.net/~kst>
    Will write code for food.
    "We must do something. This is something. Therefore, we must do this."
    -- Antony Jay and Jonathan Lynn, "Yes Minister"
     
    Keith Thompson, Aug 22, 2012
    #11
  12. Andrew Cooper <> writes:
    > On 22/08/2012 18:34, lovecreatesbeauty wrote:

    [...]
    >> . what will the man who said "C++ is horrible language" and his
    >> related linux project do?

    >
    > Continue to be the same because, while he is particularly vocal in his
    > opinion, he is correct when it comes to a kernel.


    I believe this refers to Linus Torvalds, primary author of the Linux
    kernel.

    [...]

    --
    Keith Thompson (The_Other_Keith) <http://www.ghoti.net/~kst>
    Will write code for food.
    "We must do something. This is something. Therefore, we must do this."
    -- Antony Jay and Jonathan Lynn, "Yes Minister"
     
    Keith Thompson, Aug 22, 2012
    #12
  13. lovecreatesbeauty

    Alan Curry Guest

    In article <>,
    Keith Thompson <> wrote:
    >Andrew Cooper <> writes:
    >> On 22/08/2012 18:34, lovecreatesbeauty wrote:

    >[...]
    >>> . what will the man who said "C++ is horrible language" and his
    >>> related linux project do?

    >>
    >> Continue to be the same because, while he is particularly vocal in his
    >> opinion, he is correct when it comes to a kernel.

    >
    >I believe this refers to Linus Torvalds, primary author of the Linux
    >kernel.


    I hope he's completely dissatisfied and enraged. The last time he got pissed
    off at one of his development tools, he took a few weeks to build a
    replacement and now we have git. Imagine the same thing happening to the
    compiler.

    --
    Alan Curry
     
    Alan Curry, Aug 22, 2012
    #13
  14. lovecreatesbeauty

    Nobody Guest

    On Wed, 22 Aug 2012 22:26:45 +0000, Alan Curry wrote:

    >>I believe this refers to Linus Torvalds, primary author of the Linux
    >>kernel.

    >
    > I hope he's completely dissatisfied and enraged. The last time he got
    > pissed off at one of his development tools, he took a few weeks to build a
    > replacement and now we have git. Imagine the same thing happening to the
    > compiler.


    His dissatisfaction with C++ relates to the language itself, not the
    tools. As the changes shouldn't affect gcc's external behaviour, it
    wouldn't matter if it was being re-written in Cobol. For Linus' purposes,
    gcc (the C compiler) will be no less suitable and g++ no more suitable
    when written in C++ than in C.
     
    Nobody, Aug 23, 2012
    #14
  15. lovecreatesbeauty

    James Kuyper Guest

    On 08/22/2012 09:07 PM, Nobody wrote:
    > On Wed, 22 Aug 2012 22:26:45 +0000, Alan Curry wrote:
    >
    >>> I believe this refers to Linus Torvalds, primary author of the Linux
    >>> kernel.

    >>
    >> I hope he's completely dissatisfied and enraged. The last time he got
    >> pissed off at one of his development tools, he took a few weeks to build a
    >> replacement and now we have git. Imagine the same thing happening to the
    >> compiler.

    >
    > His dissatisfaction with C++ relates to the language itself, not the
    > tools. As the changes shouldn't affect gcc's external behaviour, it
    > wouldn't matter if it was being re-written in Cobol. For Linus' purposes,
    > gcc (the C compiler) will be no less suitable and g++ no more suitable
    > when written in C++ than in C.


    His biggest complaints about C++ were about the maintainability of the
    code. If his complaints are valid, the implementation using C++ will be
    much buggier than the current one using C, in which case both gcc and
    g++ will be less suitable when implemented using C++ than when
    implemented using C. It's correspondingly important to know whether or
    not his complaints are valid. I don't have sufficiently wide experience
    to judge the issue.
    --
    James Kuyper
     
    James Kuyper, Aug 23, 2012
    #15
  16. lovecreatesbeauty

    Les Cargill Guest

    James Kuyper wrote:
    > On 08/22/2012 09:07 PM, Nobody wrote:
    >> On Wed, 22 Aug 2012 22:26:45 +0000, Alan Curry wrote:
    >>
    >>>> I believe this refers to Linus Torvalds, primary author of the Linux
    >>>> kernel.
    >>>
    >>> I hope he's completely dissatisfied and enraged. The last time he got
    >>> pissed off at one of his development tools, he took a few weeks to build a
    >>> replacement and now we have git. Imagine the same thing happening to the
    >>> compiler.

    >>
    >> His dissatisfaction with C++ relates to the language itself, not the
    >> tools. As the changes shouldn't affect gcc's external behaviour, it
    >> wouldn't matter if it was being re-written in Cobol. For Linus' purposes,
    >> gcc (the C compiler) will be no less suitable and g++ no more suitable
    >> when written in C++ than in C.

    >
    > His biggest complaints about C++ were about the maintainability of the
    > code. If his complaints are valid, the implementation using C++ will be
    > much buggier than the current one using C, in which case both gcc and
    > g++ will be less suitable when implemented using C++ than when
    > implemented using C. It's correspondingly important to know whether or
    > not his complaints are valid. I don't have sufficiently wide experience
    > to judge the issue.
    >



    There are classes of bugs that C++ can eliminate entirely. And there
    are classes of bugs in C++ that are much less fun to debug. This being
    said, so long as the bugs are reproducible, it's just money and time.

    --
    Les Cargill
     
    Les Cargill, Aug 23, 2012
    #16
  17. On Wednesday, August 22, 2012 8:40:28 PM UTC, William Ahern wrote:
    >
    > This just isn't the case. The collective decision to move to C++ was long
    >
    > and politely contentious (and not really news if you've been following
    >
    > things). A large number, perhaps even a majority, were happy sticking with
    >
    > C. But there was some number of contributors who strongly agitated to move
    >
    > to C++, and keeping those contributors happy was apparently enough
    >
    > justitication to make the move.
    >
    >
    >
    > One of the biggest arguments for sticking with C was that more people were
    >
    > proficient in C. However, major software vendors involved in the FOSS
    >
    > community, including Google, have come to favor C++ for myriad reasons, most
    >
    > not having anything to do with merit.
    >


    Will there be two sets of implemention of GCC, one in C and another in C++.

    It's a change to switch back to C in case the latter one f_cked up.
     
    lovecreatesbeauty, Aug 23, 2012
    #17
  18. lovecreatesbeautyæ–¼ 2012å¹´8月23日星期四UTC+8下åˆ3時15分39秒寫é“:
    > On Wednesday, August 22, 2012 8:40:28 PM UTC, William Ahern wrote:
    >
    > >

    >
    > > This just isn't the case. The collective decision to move to C++ was long

    >
    > >

    >
    > > and politely contentious (and not really news if you've been following

    >
    > >

    >
    > > things). A large number, perhaps even a majority, were happy sticking with

    >
    > >

    >
    > > C. But there was some number of contributors who strongly agitated to move

    >
    > >

    >
    > > to C++, and keeping those contributors happy was apparently enough

    >
    > >

    >
    > > justitication to make the move.

    >
    > >

    >
    > >

    >
    > >

    >
    > > One of the biggest arguments for sticking with C was that more people were

    >
    > >

    >
    > > proficient in C. However, major software vendors involved in the FOSS

    >
    > >

    >
    > > community, including Google, have come to favor C++ for myriad reasons,most

    >
    > >

    >
    > > not having anything to do with merit.

    >
    > >

    >
    >


    > Will there be two sets of implemention of GCC, one in C and another in C++.
    >
    >
    >
    > It's a change to switch back to C in case the latter one f_cked up.


    C++ is good for those not interested in the hardware platform.

    The auto-sizable vector container reminds me the array in basica.

    It is also good for LISP users to get what they wanted and cried long time
    ago.
     
    88888 Dihedral, Aug 23, 2012
    #18
  19. lovecreatesbeauty

    Mark Bluemel Guest

    On 23/08/2012 08:15, lovecreatesbeauty wrote:

    > Will there be two sets of implemention of GCC, one in C and another in C++.


    Why don't you ask on one of the GCC mailing lists rather than a general
    C forum?
     
    Mark Bluemel, Aug 23, 2012
    #19
  20. On 22/08/2012 21:20, Vincenzo Mercuri wrote:
    > On 22/08/2012 21:45, BartC wrote:
    >
    > [..]
    >>
    >> It's no surprise that there might be better languages for implementing
    >> compilers with than C. Especially with much faster hardware now that
    >> allows more productive languages to be used.
    >>
    >> But I wouldn't have chosen C++..
    >>

    >
    > Don't forget that GCC itself is a set of programs that need to run
    > "reasonably fast". It would take very long to compile the QT libraries
    > if GCC was implemented in any scripting language. C++ seems to offer
    > the best compromise between abstractions and performance.
    >


    I don't know. There are plenty of fast languages that are not C or C++.
    Haskell strikes me as an interesting language that is both "fast enough"
    and extremely expressive.
     
    Chicken McNuggets, Aug 23, 2012
    #20
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Hartmut Sbosny

    Linker Message: "discarded section"

    Hartmut Sbosny, May 27, 2005, in forum: C++
    Replies:
    2
    Views:
    3,399
    Hartmut Sbosny
    May 29, 2005
  2. Bengt Richter
    Replies:
    2
    Views:
    284
    Bengt Richter
    Sep 4, 2005
  3. Chad
    Replies:
    11
    Views:
    483
    Chris Dollin
    Jun 7, 2007
  4. Anonymous
    Replies:
    10
    Views:
    544
    Jorgen Grahn
    Aug 26, 2012
  5. Nomen Nescio

    Re: GCC is re-implementing in C++ and C discarded

    Nomen Nescio, Aug 26, 2012, in forum: C Programming
    Replies:
    0
    Views:
    354
    Nomen Nescio
    Aug 26, 2012
Loading...

Share This Page