<?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 &#187; Programming</title>
	<atom:link href="http://www.airs.com/blog/archives/category/programming/feed" rel="self" type="application/rss+xml" />
	<link>http://www.airs.com/blog</link>
	<description>Ian Lance Taylor</description>
	<lastBuildDate>Tue, 31 Aug 2010 14:28:32 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Condensation Computing</title>
		<link>http://www.airs.com/blog/archives/393</link>
		<comments>http://www.airs.com/blog/archives/393#comments</comments>
		<pubDate>Tue, 31 Aug 2010 14:28:32 +0000</pubDate>
		<dc:creator>Ian Lance Taylor</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.airs.com/blog/?p=393</guid>
		<description><![CDATA[It&#8217;s a frequent observation that computing has oscillated between centralized and distributed. We&#8217;ve gone from centralized computing facilities (which were effectively single-user, but only the administrators could use them) to time-sharing to personal computers to server farms. Data has moved from the card deck you kept in your office to the tape deck at the [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s a frequent observation that computing has oscillated between centralized and distributed.  We&#8217;ve gone from centralized computing facilities (which were effectively single-user, but only the administrators could use them) to time-sharing to personal computers to server farms.  Data has moved from the card deck you kept in your office to the tape deck at the computer center to the hard disk on your personal computer to the hard disk on a centralized server to a cloud site like Flickr.  E-mail has moved from a mailbox on a timesharing system to your personal computer to a cloud site like GMail.  People increasingly access data from their phones, but the data is stored in the cloud.</p>
<p>Right now we are clearly in a distributed trend.  Data is increasingly stored in the cloud and accessed from a variety of devices.  People shift from phones to laptops to desktops and expect to see the same list of contacts, the same e-mail, the same calendar.  The cloud sites are an extreme version of centralization: millions of users store their data in the same place.  What will the computing world look like when and if it oscillates back to a more distributed system?</p>
<p>One possibility is that people will increasingly acquire their own data storage which will be accessible over the net.  They&#8217;ll keep small cheap redundant servers to hold their data.  They&#8217;ll have one server at home and one at the office, and they will automatically sync up.  Access will be very fast most of the time, and will be possible at over times.  The servers will be updated automatically and so forth, and they will (somehow) be easy to administer.  The advantage will be fast access to data most of the time and actual control over your data.  If you want to delete something, it&#8217;s gone, and not available for resurrection.</p>
<p>That particular vision is easy for me to think of because it&#8217;s similar to our ideas when I co-founded a company, Zembu, back in 1998.  I don&#8217;t know how compelling it is.  I suspect that going back to a distributed environment will require some cost advantage, and I&#8217;m not sure I see that here.  Much of cloud computing these days tends to be free, in the sense that advertising pays the bills.  Few people will spend money to avoid ads.  Few is more than zero, but it&#8217;s not enough to build a business on.</p>
<p>During any predominant paradigm it&#8217;s difficult to see what the next paradigm will be.  History suggests that we will oscillate back, that the cloud will condense at some point.  But history is not always right.  It seems inherently unlikely to me that data will increasingly be centralized.  But I don&#8217;t know what the alternative will look like.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.airs.com/blog/archives/393/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<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 that [...]]]></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>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 panic is interrupted, [...]]]></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>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 around. There [...]]]></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 continues to get [...]]]></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>
		<item>
		<title>Destructors</title>
		<link>http://www.airs.com/blog/archives/362</link>
		<comments>http://www.airs.com/blog/archives/362#comments</comments>
		<pubDate>Tue, 18 May 2010 13:30:17 +0000</pubDate>
		<dc:creator>Ian Lance Taylor</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.airs.com/blog/?p=362</guid>
		<description><![CDATA[The Go language does not have destructors. Instead, it has two more dynamic mechanisms. A defer statement may be used to run a function on function exit or when processing a panic. A finalizer may be used to run a function when the garbage collector finds that a block of memory has nothing pointing to [...]]]></description>
			<content:encoded><![CDATA[<p>The Go language does not have destructors.  Instead, it has two more dynamic mechanisms.  A <code>defer</code> statement may be used to run a function on function exit or when processing a <code>panic</code>.  A finalizer may be used to run a function when the garbage collector finds that a block of memory has nothing pointing to it and can be released.  Both approaches are dynamic, in that you have to executed the <code>defer</code> statement or call the <code>runtime.SetFinalizer</code> function.  They are have no lexical scoping; a single <code>defer</code> statement in a loop can cause its argument to be called many times on function exit.</p>
<p>These ideas are significantly different from destructors, which are associated with a type, and are executed when an object of that type goes out of lexical scope or is explicitly deleted.  Destructors are primarily used to release resources acquired by an object of the type.  This is a less important concept in a garbage collected language like Go.</p>
<p>The absence of destructors means that Go does not support the RAII pattern, in which an object is used to acquire a mutex or some other resource for the scope of a lexical block.  Implementing this in Go requires two statements: one to acquire the mutex, and a <code>defer</code> statement to release the mutex on function exit.  Because deferred functions are run on function exit, the mapping is not exact; you can not use this technique to acquire a lock in a loop.  In fact, acquiring a mutex in a loop and correctly releasing it when a panic occurs is rather difficult in Go; fortunately it is easy to handle correctly by moving the body of the loop to a separate function.  In any case, Go discourages this type of programming.  Mutexes are available in Go, but channels are the preferred mechanism for synchronization.</p>
<p>Are <code>defer</code> statements and finalizers sufficient replacement for destructors in a garbage collected language?  They are for me.  When I write C++ my destructors are almost entirely concerned with releasing memory.  In fact, in the gold linker I often deliberately omitted destructors, because many of the data structures live for the life the program; in such a case, destructors serve only to slow down program exit.  I would be interested to hear of a pattern of programming which relies on destructors for cases other than releasing memory or RAII.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.airs.com/blog/archives/362/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Container Models</title>
		<link>http://www.airs.com/blog/archives/349</link>
		<comments>http://www.airs.com/blog/archives/349#comments</comments>
		<pubDate>Fri, 30 Apr 2010 13:58:52 +0000</pubDate>
		<dc:creator>Ian Lance Taylor</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.airs.com/blog/?p=349</guid>
		<description><![CDATA[A long time ago a friend of mine pointed out a sign of trouble in any program: defining a new container model. If you are working in a language that provides containers in the standard library, then use them. If you need a container with specific behaviour, then make it look like the standard containers. [...]]]></description>
			<content:encoded><![CDATA[<p>A long time ago a friend of mine pointed out a sign of trouble in any program: defining a new container model.  If you are working in a language that provides containers in the standard library, then use them.  If you need a container with specific behaviour, then make it look like the standard containers.  If you come across a program which introduces a new model, beware.</p>
<p>I&#8217;ve recently been adding Go support to SWIG.  SWIG can be used to build interfaces between various different languages and C++.  SWIG is a nice program in many ways: it provides a lot of power and flexibility in defining the interface.  Internally, though, big chunks are written in C++ but it uses a totally different container model.  I assume this is for historical reasons dating back to a beginning in C or possibly even Python.  In C++, though, it&#8217;s a mess.  There is no type checking: it&#8217;s all <code>void *</code> pointers.  Practically every type (strings, lists, hash tables) converts to everything else implicitly.  It brings all the weaknesses of a pure dynamically typed language into C++, without providing any of the benefits.</p>
<p>Sometimes one encounters a programmer who carries a container model from program to program, rewriting it into different languages as needed.  The result is a program written for one person.  Don&#8217;t do that.  Use a language in the idioms of the language; don&#8217;t try to make it look like a different language.  Use the containers which the language provides.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.airs.com/blog/archives/349/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Software Paradigms</title>
		<link>http://www.airs.com/blog/archives/342</link>
		<comments>http://www.airs.com/blog/archives/342#comments</comments>
		<pubDate>Wed, 21 Apr 2010 05:22:28 +0000</pubDate>
		<dc:creator>Ian Lance Taylor</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.airs.com/blog/?p=342</guid>
		<description><![CDATA[In my youth there was a lot of support for object oriented programming. It was generally agreed that we had a software productivity problem: it was too hard to write programs. The solution was supposedly to adopt object oriented programming techniques. This was expressed in its purest form in Smalltalk, and was brought to the [...]]]></description>
			<content:encoded><![CDATA[<p>In my youth there was a lot of support for object oriented programming.  It was generally agreed that we had a software productivity problem: it was too hard to write programs.  The solution was supposedly to adopt object oriented programming techniques.  This was expressed in its purest form in Smalltalk, and was brought to the masses in Object Pascal (later Delphi) and C++, followed by Java.</p>
<p>Object oriented programming had a few different ideas, all of which centered around the notion of separating data into relatively small and independent units.  Methods are defined independently of specific data, and a given method may  be applied to different data units.  Data units are grouped by sets of methods, and the method sets can be put into inheritance and abstraction hierarchies.</p>
<p>Object oriented approaches were greatly oversold, and it became clear over time that while they did have many good ideas, they were not the solution to the problems of programming.  One of the problems of the object oriented approach is that it encourages you to focus on the relationship between sets of methods that apply to data, rather than focusing on the structure of the data itself.  In C++ or Java terms, it&#8217;s easy to spend more time thinking about the inheritance relationships between classes than about the individual objects.</p>
<p>Over time, C++ shifted toward a somewhat different style of programming found in the Standard Template Library.  This style is based on templates, and focuses on containers and algorithms.  I&#8217;ve seen people advocate this approach to the point of saying that a good program should have no non-abstract loops: that everything should be done via an appropriate algorithm.</p>
<p>The issue I find with these approaches in practice is that they tend to lead to too much abstraction.  Fundamentally all programs deal with data.  The goal of a program is to manipulate the data in some way.  The goal of abstraction and class inheritance is to permit you to write less code.  The goal of data encapsulation is to make your program more maintainable over time.  Abstraction beyond those points may make your program better by some artificial index, but it is not really helping you get things done.</p>
<p>If you find yourself asking yourself whether to introduce a new level in your class hierarchy, or you find yourself writing a new template which will only be instantiated once, then you may be falling victim to the abstraction penalty.  Shake it off and return to focusing on what your program really needs to do.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.airs.com/blog/archives/342/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>AOL Facebook</title>
		<link>http://www.airs.com/blog/archives/338</link>
		<comments>http://www.airs.com/blog/archives/338#comments</comments>
		<pubDate>Wed, 14 Apr 2010 13:31:13 +0000</pubDate>
		<dc:creator>Ian Lance Taylor</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.airs.com/blog/?p=338</guid>
		<description><![CDATA[The first computer networks widely used outside of academia were things like CompuServe, Prodigy and then AOL. They were walled gardens: all you could access were the things they provided. With the wider spread of the Internet, they slowly granted increasing access to the Internet. Eventually everybody just used the Internet directly via an Internet [...]]]></description>
			<content:encoded><![CDATA[<p>The first computer networks widely used outside of academia were things like CompuServe, Prodigy and then AOL.  They were walled gardens: all you could access were the things they provided.  With the wider spread of the Internet, they slowly granted increasing access to the Internet.  Eventually everybody just used the Internet directly via an Internet Service Provider.  AOL still exists, but it has fallen far from its glory days.  The lesson I took was that walled gardens don&#8217;t work.</p>
<p>The success of Facebook belies that lesson.  It seems clear that many people conduct a large portion of their Internet life entirely within Facebook.  Facebook provides various different forms of communication&mdash;e-mail, chat, photo sharing, etc.&#038;mdashbut it all exists only within Facebook.  Sure, you can point offsite, but it&#8217;s hardly the main form of communication.  Facebook is a newer and larger version of the walled gardens of yesterday.</p>
<p>I don&#8217;t myself find Facebook to be interesting or useful.  I do have an account, but I only go to the Facebook site when I get some message from it.  Typically it&#8217;s because somebody wrote something on my &#8220;wall;&#8221; why they didn&#8217;t just send me an e-mail message, I don&#8217;t know.</p>
<p>Widespread use of Facebook does not necessarily translate to revenue, but all the rumors these days are that they are making plenty of money.  The introduction of games which people are willing to pay small amounts of money for was a brilliant idea in this regard&mdash;at least, I assume that Facebook gets a small cut.</p>
<p>So my lesson about walled gardens was wrong.  Walled gardens works fine if they are compelling enough.  That would be fine if Facebook takes its position as a platform seriously enough, if they work to provide neutral access to everybody.  So far they do.  Their history of trying different approaches is not too encouraging in this regard, but the economics support it.  I just wish that I liked the site more.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.airs.com/blog/archives/338/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>SCO</title>
		<link>http://www.airs.com/blog/archives/336</link>
		<comments>http://www.airs.com/blog/archives/336#comments</comments>
		<pubDate>Wed, 07 Apr 2010 03:35:24 +0000</pubDate>
		<dc:creator>Ian Lance Taylor</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.airs.com/blog/?p=336</guid>
		<description><![CDATA[I was thinking recently about my visit to SCO back in 2003. Since then SCO has been through bankruptcy and their various court cases have collapsed several times, although they are still struggling on. Their argument was always very weak. I could see that at the time, although I was also scared that the court [...]]]></description>
			<content:encoded><![CDATA[<p>I was thinking recently about 	<a href="http://www.airs.com/ian/essays/sco/sco.html">my visit to SCO</a> back in 2003.  Since then SCO has been through bankruptcy and their various court cases have collapsed several times, although they are still struggling on.  Their argument was always very weak.  I could see that at the time, although I was also scared that the court might come to the wrong decision anyhow.  Fortunately that has not happened to date.</p>
<p>What I think most about was Blake Stowell&#8217;s question to me as I was leaving.  Blake Stowell was at the time SCO&#8217;s Director of Public Relations.  He asked what I would do if I owned some proprietary code that somebody else had copied, implying that SCO&#8217;s behaviour was not merely legally justified but was even morally justified.  It was a long time ago, but the impression that I recall was that he sincerely thought that SCO was doing something which reasonable people would consider to be OK, and wanted to see whether I agreed.  My answer at the time was not very good.</p>
<p>It&#8217;s a question which I now think brings us to the heart of copyright laws.  If I write something myself, what rights do I have to prevent other people from making derivative works?  If I buy the rights to something that somebody else wrote, do I have the same rights with regard to derivative works?  Does it matter how those derivative works are being used?  I&#8217;m raising these rhetorical questions not as a matter of law&mdash;the law is what it is&mdash;but as a matter of what we, as a society, ideally want to permit.  SCO was acting as the copyright equivalent of a patent troll: they acquired the rights to something which they did not create, and attempted to gain revenue from other people using the same ideas.  Should we permit that?</p>
<p>In considering issues like this, it&#8217;s very important to not mix up copyright with real property.  It&#8217;s natural to start thinking that something that I write is like something that I own.  If I own a car, it&#8217;s not OK for somebody to drive it without my permission.  The issues with code are far less clear.  Copyright is a balance between the rights of the authors and the rights of everybody else.  Copyright does not last forever, unlike my ownership of the car.  There are various exceptions to copyright, such as fair use.  Even if we take SCO&#8217;s very best case, they were talking about a tiny percentage of code being copied from an earlier version of Unix into the Linux kernel.  Did that give them the right to charge people for using the Linux kernel?  If the code was removed from the Linux kernel, as did in fact happen later, would they still have the right to charge based on an expansive notion of derived work?</p>
<p>Intuitively I think that while the original author has considerable rights to control code that she or he writes, those rights tend to decrease with time and distance.  It&#8217;s not obvious to me that control over an author&#8217;s work is something that can be sold or inherited.  It also makes a difference whether the work is used in its entirety or whether a portion of the work is excerpted.  It also makes a difference whether the work is used by itself or in combination with work by other authors.</p>
<p>Unfortunately these issues are all fuzzy.  For law to be useful, the issues have to be spelled out, which is hard, and tends to give too much weight to the author at the expense of the rest of society.  And the rules appropriate for books and music may not be appropriate for code.</p>
<p>A sane copyright law has to make it clear that legal assertions like the ones that SCO made claiming to own Linux are unsupportable.  The remedy for minor code copying is to remove the copied code; it is not to grant ownership rights to the larger package into which the code was copied.</p>
<p>SCO&#8217;s actions were not justified.  The fact that they appear to be failing is a triumph of justice.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.airs.com/blog/archives/336/feed</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>
