<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Airs - Ian Lance Taylor</title>
	<atom:link href="http://www.airs.com/blog/feed" rel="self" type="application/rss+xml" />
	<link>http://www.airs.com/blog</link>
	<description>Ian Lance Taylor</description>
	<lastBuildDate>Sun, 25 Jul 2010 20:05:14 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Clever Machines</title>
		<link>http://www.airs.com/blog/archives/386</link>
		<comments>http://www.airs.com/blog/archives/386#comments</comments>
		<pubDate>Sun, 25 Jul 2010 20:05:14 +0000</pubDate>
		<dc:creator>Ian Lance Taylor</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.airs.com/blog/?p=386</guid>
		<description><![CDATA[I&#8217;ve always found it easy to deal with machines, as I expect is true of most computer programmers.  The interface to a machine is not always logical, but it is normally consistent in the sense that it always behaves the same way given the same inputs, and it is normally unambiguous in the sense [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve always found it easy to deal with machines, as I expect is true of most computer programmers.  The interface to a machine is not always logical, but it is normally consistent in the sense that it always behaves the same way given the same inputs, and it is normally unambiguous in the sense that it either works or it doesn&#8217;t, and it is clear which state is which.  At lest for me, dealing with machines is simpler than dealing with people when things go wrong&mdash;machines may be frustrating but at least they&#8217;re frustrating for relatively simple and ultimately comprehensible reasons.</p>
<p>Unfortunately, I&#8217;ve started to notice that as programs get smarter and as interface designers get more clever, machines are becoming more like people.  Interfaces for web sites and phones are increasingly adjusting based on your past interactions.  In many ways this is good, as over time the interaction gets smoother and easier.  However, it means that there is a lack of consistency: an input today does not produce the same effect as the same input did yesterday.  It also means that there is an increase in ambiguity: it&#8217;s difficult to tell the difference between working correctly and being slightly broken.</p>
<p>In effect, the computing world is becoming increasingly tuned for people who prefer dealing with people rather than people who prefer dealing with machines.  On average this is of course a good thing, as most of the population seems to find it frustrating to deal with machines.  But it&#8217;s somewhat ironic considering that the programmers doing most of the work tend to be people who prefer dealing with machines.</p>
<p>I don&#8217;t want to give up the advantages I get when things go well, so I guess I&#8217;m stuck in an increasingly inconsistent and ambiguous world.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.airs.com/blog/archives/386/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Living with the Past</title>
		<link>http://www.airs.com/blog/archives/384</link>
		<comments>http://www.airs.com/blog/archives/384#comments</comments>
		<pubDate>Sun, 18 Jul 2010 19:23:52 +0000</pubDate>
		<dc:creator>Ian Lance Taylor</dc:creator>
				<category><![CDATA[Random]]></category>

		<guid isPermaLink="false">http://www.airs.com/blog/?p=384</guid>
		<description><![CDATA[I&#8217;m in Stockholm for a few weeks, which is why I haven&#8217;t been updating this blog.  I&#8217;ve been in Sweden many times before, but one thing I&#8217;ve noticed particularly this time is the way that old existing buildings have been adapted for modern times.  It&#8217;s quite common to see stone steps which look [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m in Stockholm for a few weeks, which is why I haven&#8217;t been updating this blog.  I&#8217;ve been in Sweden many times before, but one thing I&#8217;ve noticed particularly this time is the way that old existing buildings have been adapted for modern times.  It&#8217;s quite common to see stone steps which look positively ancient with two pieces of wood, looking nearly as ancient, laid on top of them for use with strollers and/or wheelchairs.</p>
<p>When life changes for an existing city, you can either adapt the city or you can replace it piece by piece.  The U.S. pretty reliably picks replacement.  It&#8217;s interesting to see a place which tries harder to adapt, a spirit no doubt encouraged by the historical nature of the buildings.</p>
<p>Stockholm is also notable for how easy it is to get around on bike.  The bike lanes here are serious alternatives to pedestrian or car traffic, with their own signs and traffic lights.  They aren&#8217;t universal, but they seem to cover the city and the immediate suburbs pretty well.  This too is of course fitted into the existing streets and bridges, somehow.  Particularly impressive is a few construction sites I&#8217;ve come across where a temporary bike lane was built because the existing one was being built over.</p>
<p>Creating high quality bike lanes may seem like an inefficient use of public funds, but of course it&#8217;s really no less efficient than building roads.  The U.S. does still mostly agree that roads are a common good, and it seems like, in cities, real bike lanes could be as well.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.airs.com/blog/archives/384/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Afghanistan</title>
		<link>http://www.airs.com/blog/archives/382</link>
		<comments>http://www.airs.com/blog/archives/382#comments</comments>
		<pubDate>Thu, 24 Jun 2010 00:44:09 +0000</pubDate>
		<dc:creator>Ian Lance Taylor</dc:creator>
				<category><![CDATA[Politics]]></category>

		<guid isPermaLink="false">http://www.airs.com/blog/?p=382</guid>
		<description><![CDATA[I don&#8217;t have a well thought out view of Afghanistan.  But General McChrystal&#8217;s counter-insurgency plan never made much sense to me.  The plan by definition requires a government which the people can trust.  But all reports are that Hamid Karzai is not trusted by the people in Afghanistan.  The election last [...]]]></description>
			<content:encoded><![CDATA[<p>I don&#8217;t have a well thought out view of Afghanistan.  But General McChrystal&#8217;s counter-insurgency plan never made much sense to me.  The plan by definition requires a government which the people can trust.  But all reports are that Hamid Karzai is not trusted by the people in Afghanistan.  The election last year was a total fiasco.  That kind of seems like a big gaping hole in the middle of the counter-insurgency plan.  You can&#8217;t build trust in a government whose leader stays in power by fraud.  McChrystal was reportedly trying to build trust in Karzai by travelling with him and boosting his position, but since frankly I can&#8217;t see why the Afghan people would trust McChrystal or the U.S. either, that seems like a flawed plan.</p>
<p>So now McChrystal is out amid reports of bickering and infighting.  But we&#8217;re still going to follow the same plan under General Petraeus.  The basic dynamic of the situation is unchanged.  How is this not going to be a disaster?</p>
<p>The U.S. made progress in Iraq, against my expectations, by showing that people had more to gain by participating in politics than they did by staying out.  In particular, the Iraqis showed themselves what a civil war would look like, and many of them backed away.  Iraq remains a long way from normal, and the former middle class remains largely outside the country, but it&#8217;s hugely better than it was four years ago.</p>
<p>Afghanistan is a much bigger country than Iraq with a much smaller population.  The political dynamics are by necessity quite different.  The political class is much smaller.  I don&#8217;t see why one would expect the same process to work.</p>
<p>It&#8217;s also worth questioning what the U.S. has to gain from Afghanistan.  Al Qaeda has relocated into Pakistan.  No reasonable person would want to let the Taliban regain control, but there is no U.S. national interest in Afghanistan.  There is no oil.  The recently trumpeted minerals wealth has little national interest to the U.S., no slouch in mineral wealth itself.  What is going to keep us there for the time it takes to turn Afghanistan into a modern society?</p>
<p>At this point I think the military approach is entirely wrong.  I think an economic approach would be much more effective.  Maybe we should try to make Kabul as secure as we can and as rich as we can, and open its gates to anybody who will enter without weapons.  Hand out radios and food.  Let the Taliban fight for the rest of the country, but show most of the people that a better way is available.  I don&#8217;t know if this would work at all, but it would be cheaper in lives and money than the current approach.</p>
<p>Since we&#8217;re not going to do that, I just hope that I&#8217;m wrong again, and that something useful comes out of this, even if I can&#8217;t see what.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.airs.com/blog/archives/382/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Death-taxis</title>
		<link>http://www.airs.com/blog/archives/380</link>
		<comments>http://www.airs.com/blog/archives/380#comments</comments>
		<pubDate>Wed, 23 Jun 2010 00:33:22 +0000</pubDate>
		<dc:creator>Ian Lance Taylor</dc:creator>
				<category><![CDATA[Random]]></category>

		<guid isPermaLink="false">http://www.airs.com/blog/?p=380</guid>
		<description><![CDATA[I&#8217;ve come across a few articles recently about how modern medicine is on the road to conquer death in the next thirty years or so.  I find this to be very unlikely, and I feel that people aren&#8217;t thinking about the real issues.  I&#8217;ve seen two general themes.  One is that the [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve come across a few articles recently about how modern medicine is on the road to conquer death in the next thirty years or so.  I find this to be very unlikely, and I feel that people aren&#8217;t thinking about the real issues.  I&#8217;ve seen two general themes.  One is that the singularity will come and change everything, which is essentially unanswerable except by rolling your eyes and backing away.  The other is that death is essentially a type of disease, and we will learn to cure it.</p>
<p>Unfortunately, death is not a disease to be cured.  It&#8217;s a fundamental aspect of life.  In the competition for food and other resources necessary for life, the most significant competitors of any individual organism are the other members of its own species.  They are the ones who seek to occupy exactly the same niche.  Complex organisms which do not die will have more size and experience than their descendants, and will therefore tend to outcompete them.  It follows that species whose organisms do not die will tend to not evolve.  They will over time be outcompeted by other species which do evolve.  Thus death is a key evolutionary strategy for any successful species.  The fact that individuals may prefer not to die is irrelevant to long term evolutionary history.</p>
<p>What this means is that death is a finely tuned aspect of ourselves, just as finely tuned as our rather remarkable ability to reproduce ourselves.  And it&#8217;s not just an aspect of ourselves, it&#8217;s an aspect of our evolutionary forebears for eons.</p>
<p>It may seem superficially that humans pass through a period of childhood, then enter a phase of stasis, and then decline and die.  However, in fact humans change slowly throughout their lives.  Arresting the aging process would be just as complex as arresting the growth process during the teenage years.  All our bodily systems are shaped by evolution to head in a particular direction.  Stopping that means changing all aspects of our bodies.  It would mean a person aged 20 who does not turn into a person aged 30.  That means changing a hundred different aspects of how the body grows.</p>
<p>The fundamental argument of the people seeking to conquer death is that the body is a machine, and that we can figure out how to fix the machine so that it does not fail.  However, the bodily machine was created by an evolutionary process, not by human design.  Think of the ugliest least comprehensible computer program you&#8217;ve ever seen, code which is uncommented and full of cross dependencies.  Think of the hacker who wrote that code&#8211;code that works but is unmaintainable.  Imagine letting that hacker work on a computer program for a million years, continually micro-optimizing and never doing a comprehensive overhaul or redesign.  Now you have to reverse engineer it.  That&#8217;s what figuring out the human body is like. Every system in the body has deep layers of complexity and is related to other systems in strange and surprising ways.  Despite all the near-miraculous advances of modern medicine, we are still only scratching the surface of understanding how the body works.  Increasing computer power will help, of course, but we don&#8217;t even know the questions to ask.  This is going to be a task of many generations, and even as we start to understand it will take far more work before we have any idea how to actually change anything.</p>
<p>Of course I could be entirely wrong, and I do think that research on aging should continue.  I just don&#8217;t see any reason for optimism.  A human who does not age would really be an entirely different species.  What reason do we have to think that we can create such a species any time in the foreseeable future?  If we could create it, what reason do we have to think that we can somehow convert ourselves?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.airs.com/blog/archives/380/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Martin Beck</title>
		<link>http://www.airs.com/blog/archives/378</link>
		<comments>http://www.airs.com/blog/archives/378#comments</comments>
		<pubDate>Tue, 22 Jun 2010 13:21:25 +0000</pubDate>
		<dc:creator>Ian Lance Taylor</dc:creator>
				<category><![CDATA[Books]]></category>

		<guid isPermaLink="false">http://www.airs.com/blog/?p=378</guid>
		<description><![CDATA[Apparently the great popularity of Stieg Larsson&#8217;s novels have triggered a new interest in Swedish mystery authors.  I&#8217;d like to plug the Martin Beck series by Maj Sjöwall and Per Wahlöö.  It&#8217;s ten books written in the 60s and 70s.
Actually, other than being Swedish, they are entirely different from Larsson&#8217;s novels.  Larsson [...]]]></description>
			<content:encoded><![CDATA[<p>Apparently the great popularity of Stieg Larsson&#8217;s novels have triggered a new interest in Swedish mystery authors.  I&#8217;d like to plug the Martin Beck series by Maj Sjöwall and Per Wahlöö.  It&#8217;s ten books written in the 60s and 70s.</p>
<p>Actually, other than being Swedish, they are entirely different from Larsson&#8217;s novels.  Larsson reads like an intelligent Dan Brown with real characterization.  The Beck novels are police procedurals, telling the story of solving a crime from the perspective of a policeman, Martin Beck.  The novels were also intended to be an examination of Swedish society, which sounds daunting but is quite effective in practice.</p>
<p>The Beck novels have some extremely funny scenes, scenes which are made all the funnier by the fact that nobody in the story considers the amusing at all, and indeed they would not be funny if you were involved in them in real life.  For example, the police breaking into what turns out to be a completely empty room in The Terrorists (Terroristerna), resulting through a series of completely plausible mishaps in several shootings and near fatalities.</p>
<p>Henning Mankell, a popular current Swedish mystery writer, is clearly strongly influenced by Sjöwall and Wahlöö.  Many of Mankell&#8217;s novels are quite good, but I prefer the earlier ones.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.airs.com/blog/archives/378/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>gccgo panic/recover</title>
		<link>http://www.airs.com/blog/archives/376</link>
		<comments>http://www.airs.com/blog/archives/376#comments</comments>
		<pubDate>Mon, 14 Jun 2010 07:35:13 +0000</pubDate>
		<dc:creator>Ian Lance Taylor</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.airs.com/blog/?p=376</guid>
		<description><![CDATA[Back in March Go picked up a dynamic exception mechanism.  Previously, when code called the panic function, it simply aborted your program.  Now, it walks up the stack to the top of the currently running goroutine, running all deferred functions.  More interestingly, if a deferred function calls the new recover function, the [...]]]></description>
			<content:encoded><![CDATA[<p>Back in March Go picked up a dynamic exception mechanism.  Previously, when code called the <code>panic</code> function, it simply aborted your program.  Now, it walks up the stack to the top of the currently running goroutine, running all deferred functions.  More interestingly, if a deferred function calls the new <code>recover</code> function, the panic is interrupted, and stops walking the stack at that point.  Execution then continues normally from the point where <code>recover</code> was called.  The <code>recover</code> function returns the argument passed to <code>panic</code>, or <code>nil</code> if there is no panic in effect.</p>
<p>I just completed the implementation of this in gccgo.  It turned out to be fairly complex, so I&#8217;m writing some notes here on how it works.</p>
<p>The language requires that panic runs the deferred functions before unwinding the stack.  This means that if the deferred function calls <code>runtime.Callers</code> (which doesn&#8217;t work in gccgo, but never mind, it will eventually) it gets a full backtrace of where the call to panic occurred.  If the language did not work that way, it would be difficult to use <code>recover</code> as a general error handling mechanism, because there would be no good way to dump a stack trace.  Building up a stack trace through each deferred function call would be inefficient.</p>
<p>The language also requires that <code>recover</code> only return a value when it is called directly from a function run by a <code>defer</code> statement.  Otherwise it would be difficult for a deferred function to call a function which uses <code>panic</code> and <code>recover</code> for error handling; the <code>recover</code> might pick up the <code>panic</code> for its caller, which would be confusing.</p>
<p>As a general gccgo principle I wanted to avoid requiring new gcc backend features.  That raised some difficulty in implementing these Go language requirements.  How can the <code>recover</code> function know whether it is being invoked directly by a function started by <code>defer</code>?  In 6g, walking up the stack is efficient.  The <code>panic</code> function can record its stack position, and the <code>recover</code> function can verify that it is at the correct distance below.  In gccgo, there is no mechanism for reliably walking up the stack other than exception stack unwinding, which does not provide a helpful API.  Even if it did, gccgo&#8217;s split stack code can introduce random additional stack frames which are painful to account for.  And there is no good way for <code>panic</code> to mark the stack in gccgo.</p>
<p>What I did instead was have the <code>defer</code> statement check whether the function is it deferring might call <code>recover</code> (e.g., it definitely calls <code>recover</code>, or it is a function pointer so we don&#8217;t know).  In that case, the <code>defer</code> statement arranges to have the deferred thunk record the return address of the deferred function at the top of the defer stack.  This value is obtained via gcc&#8217;s address-of-label extension, so no new feature was required.  This gives us a value which a function which calls <code>recover</code> can check, because a function can always reliably determine its own return address via gcc&#8217;s <code>__builtin_return_address</code> function.</p>
<p>However, if the stack is split, then <code>__builtin_return_address</code> will return the address of the stack splitting cleanup code rather than the real caller.  To avoid that problem, a function which calls <code>recover</code> is split into two parts.  The first part is a small thunk which is marked to not permit its stack to be split.  This thunk gets its return address and checks whether it is being invoked directly from defer.  It passes this as a new boolean parameter to the real function, which does permit a split stack.  The real function checks the new parameter before calling <code>recover</code>; if it is false, it just produces a <code>nil</code> rather than calling <code>recover</code>.  The real function is marked uninlinable, to ensure that it is not inlined into its only call site, which could blow out the stack.</p>
<p>That is sufficient to let us know whether <code>recover</code> should return a panic value if there is one, at the cost of having an extra thunk for every function which calls <code>recover</code>.  Now we can look at the <code>panic</code> function.  It walks up the defer stack, calling functions as it goes.  When a function sucessfully calls <code>recover</code>, the panic stack is marked.  This stops the calls to the deferred functions, and starts a stack unwind phase.  The stack unwinding is done exactly the way that g++ handles exceptions.  The g++ exception mechanism is general and cross-language, so this part was relatively easy.  This means that every function that calls <code>recover</code> has an exception handler.  The exception handlers are all the same: if this is the function in which <code>recover</code> returned a value, then simply return from the current function, effectively stopping the stack unwind.  If this is not the function in which <code>recover</code> returned a value, then resume the stack unwinding, just as though the exception were rethrown in C++.</p>
<p>This system is somewhat baroque but it appears to be working.  Everything is reasonably efficient except for a call to <code>recover</code> which does not return <code>nil</code>; that is as expensive as a C++ exception.  Perhaps I will think of ways to simplify it over time.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.airs.com/blog/archives/376/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Proposition 16</title>
		<link>http://www.airs.com/blog/archives/374</link>
		<comments>http://www.airs.com/blog/archives/374#comments</comments>
		<pubDate>Sat, 05 Jun 2010 18:21:10 +0000</pubDate>
		<dc:creator>Ian Lance Taylor</dc:creator>
				<category><![CDATA[Politics]]></category>

		<guid isPermaLink="false">http://www.airs.com/blog/?p=374</guid>
		<description><![CDATA[California&#8217;s proposition 16, which will be voted on next Tuesday, is an interesting use of California&#8217;s bizarre ballot initiative process.  The proposition says that if a local government wants to start a municipal electrical utility, it must get a 2/3 majority of votes.  The proposition was initiated and almost entirely funded by PG&#038;E, [...]]]></description>
			<content:encoded><![CDATA[<p>California&#8217;s proposition 16, which will be voted on next Tuesday, is an interesting use of California&#8217;s bizarre ballot initiative process.  The proposition says that if a local government wants to start a municipal electrical utility, it must get a 2/3 majority of votes.  The proposition was initiated and almost entirely funded by PG&#038;E, a California electric company, which has reportedly spent over $35 million on advertising in support of the proposition.  I rarely watch television, but I&#8217;ve received quite a few flyers in the mail about it.  Some even list a long set of candidates and positions to endorse, along with proposition 16.  However, since these flyers are required to list the groups which explicitly endorsed the flyer, it&#8217;s easy to see that the flyers are being put out for proposition 16, and they are trying to slide in support for it along with other candidates I might be inclined to vote for anyhow.</p>
<p>PG&#038;E is the only company from which I can buy my electricity.  Electricity distribution is a classic natural monopoly; why would two different companies put up wires to everybody&#8217;s house?  Since modern life requires electricity, and since I can only get it from PG&#038;E, I am a PG&#038;E customer.  Proposition 16 appears to be designed solely to preserve PG&#038;E&#8217;s monopoly position, by making it much harder for communities to create their own municipal power companies.  It would be hard enough to get a majority vote in favor of government run power; I think we can assume that a 2/3 majority would be effectively impossible.  It&#8217;s pretty darn annoying that PG&#038;E is spending $35 million, including money they collect from me, on this.  Is that a good use of my money?</p>
<p>Municipal power is not impossible.  For example, Palo Alto, California, uses a municipal power utility.  It was notable during the rolling blackouts that affected most of California in the early 2000s that Palo Alto was immune.  So it&#8217;s not as though PG&#038;E deserves to be protected because they are doing a particularly good job.  When a real crunch time came, they did a very poor job indeed.</p>
<p>It&#8217;s difficult for me to imagine why anybody would vote in favor of such a blatant power grab by a private company.  But then, of course, there&#8217;s the $35 million.  The opponents of proposition 16 have reportedly raised less than $100,000.  I assume that if PG&#038;E succeeds we will see more and more cases where private companies spend lots of money on ballot initiatives in their favor.  I hope that it fails, and if I have any readers in California I encourage you to vote against proposition 16 this Tuesday.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.airs.com/blog/archives/374/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Shrek Distances</title>
		<link>http://www.airs.com/blog/archives/372</link>
		<comments>http://www.airs.com/blog/archives/372#comments</comments>
		<pubDate>Thu, 03 Jun 2010 00:23:11 +0000</pubDate>
		<dc:creator>Ian Lance Taylor</dc:creator>
				<category><![CDATA[Movies]]></category>

		<guid isPermaLink="false">http://www.airs.com/blog/?p=372</guid>
		<description><![CDATA[I&#8217;m sure I&#8217;m not the only person troubled by the loose geography in the Shrek movies.  In the first movie Shrek takes a couple of days to get to the dragon&#8217;s castle.  In the second movie Shrek and Fiona appear to take a few days to get from Shrek&#8217;s swamp to Far Far [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m sure I&#8217;m not the only person troubled by the loose geography in the Shrek movies.  In the first movie Shrek takes a couple of days to get to the dragon&#8217;s castle.  In the second movie Shrek and Fiona appear to take a few days to get from Shrek&#8217;s swamp to Far Far Away by coach.  However, in the fourth movie, Shrek walks from his swamp to the dragon&#8217;s castle and then to Far Far Away all in a single night.  There is no explanation.  How is this possible?</p>
<p>Even allegorical fairy tales are weakened by a lack of internal story consistency.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.airs.com/blog/archives/372/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>GCC in C++</title>
		<link>http://www.airs.com/blog/archives/370</link>
		<comments>http://www.airs.com/blog/archives/370#comments</comments>
		<pubDate>Tue, 01 Jun 2010 13:29:08 +0000</pubDate>
		<dc:creator>Ian Lance Taylor</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.airs.com/blog/?p=370</guid>
		<description><![CDATA[I&#8217;m very pleased to see that the GCC steering committee has agreed to permit GCC to be written in C++.  At one time RMS, who is a member of the steering committee, had felt that C++ was never appropriate for systems programs like GCC.  It&#8217;s good to see that he has apparently come [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m very pleased to see that the GCC steering committee has <a href="http://gcc.gnu.org/ml/gcc/2010-05/msg00705.html">agreed to permit GCC to be written in C++</a>.  At one time RMS, who is a member of the steering committee, had felt that C++ was never appropriate for systems programs like GCC.  It&#8217;s good to see that he has apparently come around.</p>
<p>There has been a long effort to prepare for this, by moving GCC&#8217;s code base from C to the common subset of C and C++.  While people naturally think of C++ as an extension to C, they are different languages and there is a lot of C code which is not valid C++.  In the GCC code base, one of the biggest issues was that enums are more restricted by the type system in C++ than they are in C.  Another was that in C++ you may not use the same name as a <code>typedef</code> and a <code>struct</code> tag, except for the special case of making the struct tag be a typedef for the struct itself.</p>
<p>Gabriel Dos Reis did the first substantial work on moving the GCC code base to the common subset, and many other people contributed.  I think it&#8217;s fair to say that I did the lion&#8217;s share of the work, starting with my surprise presentation on the advantages of C++ at the 2008 GCC Summit.  I did a lot of work to improve the <code>-Wc++-compat</code> warning option to warn about C code which was not in the C/C++ common subset, and I did a lot of work to make GCC code compile with that option without warnings.</p>
<p>C++ will not magically make the GCC code base better.  However, I believe that it will give us some useful tools to incrementally improve the code base over time, making it easier to read, easier to modify, and more efficient.  I say this not based on theory, but on my experiences with gold and with the gccgo frontend.  I&#8217;ve already started writing some <a href="http://gcc.gnu.org/wiki/CppConventions">draft C++ coding conventions</a> which I hope we can use to guide our efforts.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.airs.com/blog/archives/370/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>GCC Project</title>
		<link>http://www.airs.com/blog/archives/368</link>
		<comments>http://www.airs.com/blog/archives/368#comments</comments>
		<pubDate>Mon, 31 May 2010 04:45:43 +0000</pubDate>
		<dc:creator>Ian Lance Taylor</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.airs.com/blog/?p=368</guid>
		<description><![CDATA[GCC as a free software project is clearly very successful.  Over more than 20 years it&#8217;s grown from nothing to become the standard compiler for several operating systems and many microprocessors.  So far in 2010 the core part of the compiler alone has seen over 1000 commits by over 100 contributors.  GCC [...]]]></description>
			<content:encoded><![CDATA[<p>GCC as a free software project is clearly very successful.  Over more than 20 years it&#8217;s grown from nothing to become the standard compiler for several operating systems and many microprocessors.  So far in 2010 the core part of the compiler alone has seen over 1000 commits by over 100 contributors.  GCC continues to get significant new features; e.g., the recent GCC 4.5 release includes a new link time optimization facility.</p>
<p>On the other hand, the GCC project has some problems.  The major individual contributors to GCC are hired to work on it.  That means that they have a lot of time and resources to use to improve the compiler, which is good.  However, it also has some negative effects.  It&#8217;s difficult for new volunteers to join the community.  It&#8217;s hard for them to learn the code base and it&#8217;s hard for them to keep up with the pace of change.  It&#8217;s also hard for them to learn the conventions of how the project works, and they get little help in getting their patches in.  Also, the people who work on GCC have learned the intricacies of the code base over time.  They do not rely on the internal documentation.  The effect is that the internal documentation for some parts of the code base is quite weak, and none of the main contributors are motivated to fix it.</p>
<p>Another, separate, problem is that there is no single person or group with a clear ability and willingness to decide on the direction of the project.  In the past the direction has been set at different times by people like Richard Stallman, Richard Kenner, Jeff Law, and Richard Henderson.  None of them are playing that role today.  The effect is that nobody can see whether significant new features should or should not go into the project, which leads to a tendency for inconclusive discussions and unreviewed patches.  People hoping to contribute are left with no clear path forward.  (I should mention that groups like the GCC Steering Committee and the GCC Release Managers are effective but do not take on this role, which is more that of an architect.)</p>
<p>A third problem is that GCC has no public relations activity.  The <a href="http://gcc.gnu.org/">project web page</a> tells you what GCC is but says nothing about how it compares to other compilers or how it has improved over time.  There are some common criticisms of GCC, such as the belief that it is measurably worse than proprietary compilers, or that it is stagnating, which the project makes no attempt to discuss or dispute.</p>
<p>None of these issues are critical.  As I said, GCC is highly successful.  But they are areas where I think GCC could improve.  Unfortunately, pointing out these issues is insufficient; it&#8217;s necessary for peole to step up to take on these roles.  The various companies which pay people to work on GCC are generally less interested in these aspects of the project, which makes it that much harder to find people to work on them.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.airs.com/blog/archives/368/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>
