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

L

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?

.. 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
 
T

Thomas Richter

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
 
F

fmassei

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!
 
J

James Kuyper

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.
 
A

Angel

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.
 
K

Keith Thompson

lovecreatesbeauty said:
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.
 
M

Malcolm McLean

בת×ריך ×™×•× ×¨×‘×™×¢×™, 22 ב×וגוסט 2012 20:08:08 UTC+1, מ×ת Keith Thompson:
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.
 
B

BartC

Malcolm McLean said:
בת×ריך ×™×•× ×¨×‘×™×¢×™, 22 ב×וגוסט 2012 20:08:08 UTC+1, מ×ת Keith Thompson:
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++..
 
V

Vincenzo Mercuri

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.
 
A

Andrew Cooper

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
 
K

Keith Thompson

BartC said:
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++.
 
K

Keith Thompson

Andrew Cooper said:
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.

[...]
 
A

Alan Curry

Andrew Cooper said:
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.
 
N

Nobody

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.
 
J

James Kuyper

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.
 
L

Les Cargill

James said:
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.
 
L

lovecreatesbeauty

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.
 
8

88888 Dihedral

lovecreatesbeautyæ–¼ 2012å¹´8月23日星期四UTC+8下åˆ3時15分39秒寫é“:
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.
 
M

Mark Bluemel

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?
 
C

Chicken McNuggets

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top