<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/1.5.2" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
	<title>Comments on: GCC in C++</title>
	<link>http://www.airs.com/blog/archives/187</link>
	<description>Ian Lance Taylor</description>
	<pubDate>Wed,  8 Oct 2008 06:11:02 +0000</pubDate>
	<generator>http://wordpress.org/?v=1.5.2</generator>

	<item>
 		<title>Comment on GCC in C++ by: ncm</title>
		<link>http://www.airs.com/blog/archives/187#comment-13460</link>
		<pubDate>Sun, 11 May 2008 00:01:55 +0000</pubDate>
		<guid>http://www.airs.com/blog/archives/187#comment-13460</guid>
					<description>pinskia: string isn't part of the STL.  It's also an unfortunate textbook example of a standard-committee orphan.  The original draft standard string was simple and clean.  Then some busybody decided it was too simple, and made a proposal to mess it up badly.  After that was accepted (at the meeting before my first) the original designer gave up.  String got very little attention for yeas after that, except what I could spare to keep it from getting even worse.

Stepanov has said that if he were starting over, STL components would have no public named member functions at all.  Before template function overloading that wasn't possible, but then they were added after it was too late to take out the member functions.</description>
		<content:encoded><![CDATA[	<p>pinskia: string isn&#8217;t part of the STL.  It&#8217;s also an unfortunate textbook example of a standard-committee orphan.  The original draft standard string was simple and clean.  Then some busybody decided it was too simple, and made a proposal to mess it up badly.  After that was accepted (at the meeting before my first) the original designer gave up.  String got very little attention for yeas after that, except what I could spare to keep it from getting even worse.</p>
	<p>Stepanov has said that if he were starting over, STL components would have no public named member functions at all.  Before template function overloading that wasn&#8217;t possible, but then they were added after it was too late to take out the member functions.
</p>
]]></content:encoded>
				</item>
	<item>
 		<title>Comment on GCC in C++ by: Ian Lance Taylor</title>
		<link>http://www.airs.com/blog/archives/187#comment-13420</link>
		<pubDate>Sat, 10 May 2008 00:43:39 +0000</pubDate>
		<guid>http://www.airs.com/blog/archives/187#comment-13420</guid>
					<description>Pinski: technically strings are not part of the STL.  String initialization does require running a constructor, which I agree is not ideal.  In fact I think it's normally unwise to use a static string, as they add nothing over a const char array.

Any l anguage can be misused.  I think many would argue that gcc's vec.h is a misuse of C.  It would be much simpler--indeed, nonexistent--in C++.  The interesting question is whether using C++, including the STL, makes it easier to write correct and/or faster code.</description>
		<content:encoded><![CDATA[	<p>Pinski: technically strings are not part of the STL.  String initialization does require running a constructor, which I agree is not ideal.  In fact I think it&#8217;s normally unwise to use a static string, as they add nothing over a const char array.</p>
	<p>Any l anguage can be misused.  I think many would argue that gcc&#8217;s vec.h is a misuse of C.  It would be much simpler&#8211;indeed, nonexistent&#8211;in C++.  The interesting question is whether using C++, including the STL, makes it easier to write correct and/or faster code.
</p>
]]></content:encoded>
				</item>
	<item>
 		<title>Comment on GCC in C++ by: pinskia</title>
		<link>http://www.airs.com/blog/archives/187#comment-13418</link>
		<pubDate>Fri, 09 May 2008 23:52:29 +0000</pubDate>
		<guid>http://www.airs.com/blog/archives/187#comment-13418</guid>
					<description>&amp;#62;Incidentally, “implicit this” is usually bad coding style.

Considering from what I heard, the C++ standards committee has mentioned that implicit cast are bad and should never have gone in.  I would have expected that they would be against implicit this also. 

-- Pinski</description>
		<content:encoded><![CDATA[	<p>&gt;Incidentally, “implicit this” is usually bad coding style.</p>
	<p>Considering from what I heard, the C++ standards committee has mentioned that implicit cast are bad and should never have gone in.  I would have expected that they would be against implicit this also. </p>
	<p>&#8211; Pinski
</p>
]]></content:encoded>
				</item>
	<item>
 		<title>Comment on GCC in C++ by: pinskia</title>
		<link>http://www.airs.com/blog/archives/187#comment-13417</link>
		<pubDate>Fri, 09 May 2008 23:51:10 +0000</pubDate>
		<guid>http://www.airs.com/blog/archives/187#comment-13417</guid>
					<description>The main problem I have with C++ is STL and how the the C++ folks normally use STL in the wrong way.  STL is a piece of *****.  Strings in STL is a good example, there is no way to have a non mutable string and no way to have no initialization code for non mutable strings.  Vectors is the same way but is less used that way.  

For the code I see here at Sony, they abuse templates to try to get around pointer aliasing issues and a couple other weird stuff.  The wrap vector types inside a class even though we define addition and a couple other stuff like subscripting (which I am testing a patch to submit to right now).  I can't tell if they are doing this wrapping for portability or just for the fun of it.

-- Pinski</description>
		<content:encoded><![CDATA[	<p>The main problem I have with C++ is STL and how the the C++ folks normally use STL in the wrong way.  STL is a piece of *****.  Strings in STL is a good example, there is no way to have a non mutable string and no way to have no initialization code for non mutable strings.  Vectors is the same way but is less used that way.  </p>
	<p>For the code I see here at Sony, they abuse templates to try to get around pointer aliasing issues and a couple other weird stuff.  The wrap vector types inside a class even though we define addition and a couple other stuff like subscripting (which I am testing a patch to submit to right now).  I can&#8217;t tell if they are doing this wrapping for portability or just for the fun of it.</p>
	<p>&#8211; Pinski
</p>
]]></content:encoded>
				</item>
	<item>
 		<title>Comment on GCC in C++ by: Ian Lance Taylor</title>
		<link>http://www.airs.com/blog/archives/187#comment-13354</link>
		<pubDate>Thu, 08 May 2008 04:55:40 +0000</pubDate>
		<guid>http://www.airs.com/blog/archives/187#comment-13354</guid>
					<description>jldugger: Interesting to hear that a school is teaching C but not C++.  In any case other high level languages are not a realistic option for gcc.

davem: I agree that get rid of GC is a completely separate project.  And you're right: I find the template bloat in gold to be basically irrelevant.  If it made gold slower, then it would be highly relevant.  But in fact, it doesn't.  I didn't introduce it because I like templates, I introduced it because it makes gold faster.  In any case I don't see any reason to use that sort of technique in gcc.

tromey: Sure, the developers should decide.  I'm casting my vote.

atgreen: This is perhaps overly cynical, but the best way to speed up C++ compilation times would be to make them matter for gcc programmers.</description>
		<content:encoded><![CDATA[	<p>jldugger: Interesting to hear that a school is teaching C but not C++.  In any case other high level languages are not a realistic option for gcc.</p>
	<p>davem: I agree that get rid of GC is a completely separate project.  And you&#8217;re right: I find the template bloat in gold to be basically irrelevant.  If it made gold slower, then it would be highly relevant.  But in fact, it doesn&#8217;t.  I didn&#8217;t introduce it because I like templates, I introduced it because it makes gold faster.  In any case I don&#8217;t see any reason to use that sort of technique in gcc.</p>
	<p>tromey: Sure, the developers should decide.  I&#8217;m casting my vote.</p>
	<p>atgreen: This is perhaps overly cynical, but the best way to speed up C++ compilation times would be to make them matter for gcc programmers.
</p>
]]></content:encoded>
				</item>
	<item>
 		<title>Comment on GCC in C++ by: ncm</title>
		<link>http://www.airs.com/blog/archives/187#comment-13329</link>
		<pubDate>Wed, 07 May 2008 19:50:03 +0000</pubDate>
		<guid>http://www.airs.com/blog/archives/187#comment-13329</guid>
					<description>Incidentally,  &quot;implicit this&quot; is usually bad coding style.</description>
		<content:encoded><![CDATA[	<p>Incidentally,  &#8220;implicit this&#8221; is usually bad coding style.
</p>
]]></content:encoded>
				</item>
	<item>
 		<title>Comment on GCC in C++ by: atgreen</title>
		<link>http://www.airs.com/blog/archives/187#comment-13321</link>
		<pubDate>Wed, 07 May 2008 14:20:58 +0000</pubDate>
		<guid>http://www.airs.com/blog/archives/187#comment-13321</guid>
					<description>Have any of the GCC hackers object yet based on compiler build times?  Compare gold build times to that of GNU ld, for instance.  I've been rebuilding GCC a lot recently for my ggx port, and it would be sad to see it get any slower considering the tremendous improvements we've seen over the years (mostly due to hardware improvements, granted).</description>
		<content:encoded><![CDATA[	<p>Have any of the GCC hackers object yet based on compiler build times?  Compare gold build times to that of GNU ld, for instance.  I&#8217;ve been rebuilding GCC a lot recently for my ggx port, and it would be sad to see it get any slower considering the tremendous improvements we&#8217;ve seen over the years (mostly due to hardware improvements, granted).
</p>
]]></content:encoded>
				</item>
	<item>
 		<title>Comment on GCC in C++ by: tromey</title>
		<link>http://www.airs.com/blog/archives/187#comment-13319</link>
		<pubDate>Wed, 07 May 2008 14:13:32 +0000</pubDate>
		<guid>http://www.airs.com/blog/archives/187#comment-13319</guid>
					<description>Many GCC developers don't like C++ -- so the principled argument here is &quot;the developers should choose&quot;.  IME these developers are often wrong on the the merits, but ... I don't know, does that matter?

Also, while I'm in favor of using C++, I am not sure that it will help with the bigger problems in GCC.  Maybe we can more easily librarify a few bits by making use of an implicit &quot;this&quot;.  But, there are plenty of other ugly things that still require lots of slogging.  It may help a bit with de-GC-ification, but even that isn't totally clear to me.</description>
		<content:encoded><![CDATA[	<p>Many GCC developers don&#8217;t like C++ &#8212; so the principled argument here is &#8220;the developers should choose&#8221;.  IME these developers are often wrong on the the merits, but &#8230; I don&#8217;t know, does that matter?</p>
	<p>Also, while I&#8217;m in favor of using C++, I am not sure that it will help with the bigger problems in GCC.  Maybe we can more easily librarify a few bits by making use of an implicit &#8220;this&#8221;.  But, there are plenty of other ugly things that still require lots of slogging.  It may help a bit with de-GC-ification, but even that isn&#8217;t totally clear to me.
</p>
]]></content:encoded>
				</item>
	<item>
 		<title>Comment on GCC in C++ by: davem</title>
		<link>http://www.airs.com/blog/archives/187#comment-13310</link>
		<pubDate>Wed, 07 May 2008 09:14:19 +0000</pubDate>
		<guid>http://www.airs.com/blog/archives/187#comment-13310</guid>
					<description>This would be an enormous project.  I think you're better off getting rid
of GC from gcc, which would be so much easier.

Sure, you could convert the gcc tree, and transition because the current
codebase is using the C subset of C++.

But any real use of C++ features, especially your target class idea, would
take a lot of work.  You'd either have to keep a &quot;C&quot; non-classed target interface
around, add some kind of wrapper target class for &quot;C&quot; targets, or have a field
day and convert everything in one go.

I mean, by all means, if you're motivated, go for it.

But, actually C++ is one of the things I've grown to dislike about gold,
especially after working with it a lot (writing a new target, fixing bugs)
and looking at the generated assembler and bloat.

I'm sorry to say this.  The bloat from templates just to support both 32-bit
and 64-bit sparc is just rediculious.  And this seems to be endemic of
templated code.  The argument seems to be that the templates instantiations
you aren't using aren't even executed or brought into memory, but as a long
time C systems level programmer I find these kinds of waste unsettling.  And
the fact that C++ programmers consider it an acceptable tradoff... even more
unsettling.

Really, ridding GCC of GC is a so much more worthwhile and doable
goal than a C++ conversion.  Although, I suppose C++ is part of one of
your imagined plans to rid GCC of GC.  If so, good luck :-)</description>
		<content:encoded><![CDATA[	<p>This would be an enormous project.  I think you&#8217;re better off getting rid<br />
of GC from gcc, which would be so much easier.</p>
	<p>Sure, you could convert the gcc tree, and transition because the current<br />
codebase is using the C subset of C++.</p>
	<p>But any real use of C++ features, especially your target class idea, would<br />
take a lot of work.  You&#8217;d either have to keep a &#8220;C&#8221; non-classed target interface<br />
around, add some kind of wrapper target class for &#8220;C&#8221; targets, or have a field<br />
day and convert everything in one go.</p>
	<p>I mean, by all means, if you&#8217;re motivated, go for it.</p>
	<p>But, actually C++ is one of the things I&#8217;ve grown to dislike about gold,<br />
especially after working with it a lot (writing a new target, fixing bugs)<br />
and looking at the generated assembler and bloat.</p>
	<p>I&#8217;m sorry to say this.  The bloat from templates just to support both 32-bit<br />
and 64-bit sparc is just rediculious.  And this seems to be endemic of<br />
templated code.  The argument seems to be that the templates instantiations<br />
you aren&#8217;t using aren&#8217;t even executed or brought into memory, but as a long<br />
time C systems level programmer I find these kinds of waste unsettling.  And<br />
the fact that C++ programmers consider it an acceptable tradoff&#8230; even more<br />
unsettling.</p>
	<p>Really, ridding GCC of GC is a so much more worthwhile and doable<br />
goal than a C++ conversion.  Although, I suppose C++ is part of one of<br />
your imagined plans to rid GCC of GC.  If so, good luck <img src='http://www.airs.com/blog/wp-images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />
</p>
]]></content:encoded>
				</item>
	<item>
 		<title>Comment on GCC in C++ by: jldugger</title>
		<link>http://www.airs.com/blog/archives/187#comment-13308</link>
		<pubDate>Wed, 07 May 2008 07:33:19 +0000</pubDate>
		<guid>http://www.airs.com/blog/archives/187#comment-13308</guid>
					<description>The thing about C++ is that its the worst high level langauge out there. Template inheritance is about the most confusing thing I've seen in a language, and I think classes introduce a layer of ambiguity about what's actually happening in the generated the code.   I suspect gcc authors might know a bit more about this than I however ;)

And it should be noted that my CIS department teaches C, Java, Python and OCaml, but not C++.  C is useful and will be for the forseeable future, but what C++ brings to the table isn't all that fantastic without an existing C codebase. So fewer schools are teaching C++, but C itself remains important as a systems language.

This said, gcc is a unique project with a large C codebase and hopefully intelligent authors.  If there are tangible benefits to the work you'd have to do in transition, you may as well try it.</description>
		<content:encoded><![CDATA[	<p>The thing about C++ is that its the worst high level langauge out there. Template inheritance is about the most confusing thing I&#8217;ve seen in a language, and I think classes introduce a layer of ambiguity about what&#8217;s actually happening in the generated the code.   I suspect gcc authors might know a bit more about this than I however <img src='http://www.airs.com/blog/wp-images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
	<p>And it should be noted that my CIS department teaches C, Java, Python and OCaml, but not C++.  C is useful and will be for the forseeable future, but what C++ brings to the table isn&#8217;t all that fantastic without an existing C codebase. So fewer schools are teaching C++, but C itself remains important as a systems language.</p>
	<p>This said, gcc is a unique project with a large C codebase and hopefully intelligent authors.  If there are tangible benefits to the work you&#8217;d have to do in transition, you may as well try it.
</p>
]]></content:encoded>
				</item>
</channel>
</rss>
