<?xml version='1.0' encoding='utf-8' ?>
<!--  If you are running a bot please visit this policy page outlining rules you must respect. http://www.livejournal.com/bots/  -->
<rss version='2.0' xmlns:lj='http://www.livejournal.org/rss/lj/1.0/'>
<channel>
  <title>cgwalters</title>
  <link>http://cgwalters.livejournal.com/</link>
  <description>cgwalters - LiveJournal.com</description>
  <lastBuildDate>Thu, 26 Jun 2008 17:47:46 GMT</lastBuildDate>
  <generator>LiveJournal / LiveJournal.com</generator>
  <lj:journal>cgwalters</lj:journal>
  <lj:journaltype>personal</lj:journaltype>
  <image>
    <url>http://p-userpic.livejournal.com/60279830/12647998</url>
    <title>cgwalters</title>
    <link>http://cgwalters.livejournal.com/</link>
    <width>100</width>
    <height>100</height>
  </image>

<item>
  <guid isPermaLink='true'>http://cgwalters.livejournal.com/17956.html</guid>
  <pubDate>Thu, 26 Jun 2008 17:47:46 GMT</pubDate>
  <title>Jython about to hit 2.5</title>
  <link>http://cgwalters.livejournal.com/17956.html</link>
  <description>&lt;p&gt;An &lt;a href=&quot;http://zyasoft.com/pythoneering/2008/06/realizing-jython-25.html&quot;&gt;excellent&lt;/a&gt; update from one of the Jython hackers (&lt;a href=&quot;http://zyasoft.com/pythoneering/2008/06/flipping-25-bit-for-jython.html&quot;&gt;and followup&lt;/a&gt;).  I particularly liked this:&lt;/p&gt;&lt;br /&gt;&lt;pre&gt;
&amp;gt;&amp;gt;&amp;gt; from __future__ import GIL
Traceback (most recent call last):
(no code object) at line 0
File &quot;&quot;, line 0
SyntaxError: Never going to happen!
&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;For me the most useful thing is that Jython SVN now supports &lt;a href=&quot;http://www.python.org/dev/peps/pep-0318/&quot;&gt;decorators&lt;/a&gt;.  I use decorators fairly extensively in my Python code, and they were the main thing blocking me from using Jython more widely.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Some people may wonder - why Jython?  One reason is that the tooling around the JVM is &lt;b&gt;awesome&lt;/b&gt;.  &lt;a href=&quot;http://java.sun.com/j2se/1.5.0/docs/guide/jpda/jdwp-spec.html&quot;&gt;JDWP&lt;/a&gt; (and clients like &lt;a href=&quot;http://eclipse.org&quot;&gt;Eclipse&lt;/a&gt;&apos;s debugger) blow away &lt;a href=&quot;http://www.gnu.org/software/gdb/&quot;&gt;gdb&lt;/a&gt;.   For a while now I&apos;ve been trying to debug a periodic lockup in a multithreaded Python process, and it&apos;s been immensely painful with gdb.  There are &lt;a href=&quot;http://java-source.net/open-source/profilers&quot;&gt;a lot&lt;/a&gt; of other extremely useful FOSS tools for heap analysis, profiling, etc.  Even if your entire world currently runs on Python, and you aren&apos;t interested in easily taking advantage of some of the other &lt;a href=&quot;http://cgwalters.livejournal.com/14310.html&quot;&gt;awesome JVM software&lt;/a&gt; out there like Hadoop, running on Jython makes sense alone just for OpenJDK being among the best Free VMs out there.&lt;/p&gt;</description>
  <comments>http://cgwalters.livejournal.com/17956.html</comments>
  <lj:security>public</lj:security>
</item>
<item>
  <guid isPermaLink='true'>http://cgwalters.livejournal.com/17760.html</guid>
  <pubDate>Wed, 25 Jun 2008 23:03:18 GMT</pubDate>
  <title>The forehead mashing method</title>
  <link>http://cgwalters.livejournal.com/17760.html</link>
  <description>&lt;p&gt;I liked &lt;a href=&quot;http://metelliuscode.wordpress.com/2008/06/25/making-arks-extraction-interface-more-efficient/&quot;&gt;this&lt;/a&gt; blog entry from Planet KDE.  That entry reminded me to talk about one way I like to think about how to improve the user experience with software - and that is by what I call the &quot;forehead mashing&quot; method.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;This is where as you&apos;re developing software, write out a few problems that you&apos;re trying to solve.  Then, for every step the user is required to make - for every dialog that pops up, for every few seconds of keystrokes, every dialog to click, every checkbox to check...lower your head onto the desk and hit your forehead.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;You don&apos;t have to do this with a lot of force.  Just enough so that you feel it.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;center&gt;&lt;img src=&quot;http://www.testdrivenjavascript.com/Images/ExtractionWizard1.JPG&quot;&gt;&lt;br /&gt;&lt;i&gt;This calls for several head-desk hits&lt;/i&gt;&lt;/center&gt;&lt;/p&gt; &lt;br /&gt;&lt;br /&gt;&lt;p&gt;One of the top things that will quickly make your forehead sore are &lt;b&gt;Wizards/Assistants&lt;/b&gt;.  The way I think of these is that the programmer is so proud of their work and they think it&apos;s so awesome and complicated that they want you to acknowledge it.&lt;/p&gt; &lt;br /&gt;&lt;p&gt;What if programmers inflicted these kinds of things on ourselves?  Say in &lt;tt&gt;gcc&lt;/tt&gt;.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;center&gt;&lt;a href=&quot;http://picasaweb.google.com/cgwalters/Screenshots/photo#5215943744498193762&quot;&gt;&lt;img src=&quot;http://lh6.ggpht.com/cgwalters/SGLBM0s8VWI/AAAAAAAABO8/gpABtp1-lSA/s800/Screenshot-gccregister.py.png&quot; /&gt;&lt;/a&gt;&lt;br&gt;&lt;i&gt;If you all keep making wizards, I&apos;ll create this patch for GCC&lt;/i&gt;&lt;/center&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;It&apos;s not just wizards of course that are the source of pointless user time spent reading text and clicking buttons; random dialogs are another source.  Often with some thought, it&apos;s really not hard to reduce and simplify.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;center&gt;&lt;img src=&quot;http://people.freedesktop.org/~david/gnome-keyring-allow-deny.png&quot;&gt;&lt;br /&gt;&lt;i&gt;This is davidz&apos;s theme, don&apos;t blame me&lt;/i&gt;&lt;/center&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;So I promised in the comments in my &lt;a href=&quot;http://cgwalters.livejournal.com/17495.html&quot;&gt;previous post&lt;/a&gt; that I would do something to reduce the pain from the notification bubble I added; to keep the universe in balance as it were.  So I&apos;m happy to say that in Fedora rawhide now, the above dialog is no more.  It was just a bad idea, and you will &lt;a href=&quot;http://bugzilla.gnome.org/show_bug.cgi?id=533493&quot;&gt;never see it again&lt;/a&gt;.&lt;/p&gt;</description>
  <comments>http://cgwalters.livejournal.com/17760.html</comments>
  <lj:security>public</lj:security>
</item>
<item>
  <guid isPermaLink='true'>http://cgwalters.livejournal.com/17495.html</guid>
  <pubDate>Tue, 27 May 2008 00:08:40 GMT</pubDate>
  <title>Some small tweaks</title>
  <link>http://cgwalters.livejournal.com/17495.html</link>
  <description>&lt;p&gt;One of the things I&apos;ve been looking at again recently is the initial experience for the desktop.  &lt;a href=&quot;http://cgwalters.livejournal.com/5659.html&quot;&gt;Previously&lt;/a&gt; we investigated reducing the number of steps by starting the browser by default; incidentally I have plan for a more refined version of that kicking around that isn&apos;t quite ready but should hopefully be soon.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;In the context of the Online Desktop work we want to get the user logged in online.  However, this requires a network connection.  Pretend for a moment you&apos;re new to the system.  Look at a default desktop, say one from the &lt;a href=&quot;http://www.phoronix.com/scan.php?page=article&amp;amp;item=991&amp;amp;num=1&quot;&gt;Phoronix Fedora 9 review&lt;/a&gt;, without the obligatory window to 1970 in the middle.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;How do you know what to do to get online?  If you&apos;re using a wired connection then you don&apos;t have to know anything; &lt;a href=&quot;http://live.gnome.org/NetworkManager&quot;&gt;NetworkManager&lt;/a&gt; does it automatically.  However a much more common case now is wireless networks, and you would have to know to click on the &quot;two computer and broken X&quot; icon in the top right.  A simple solution is to have a notification pointing to it:&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;center&gt;&lt;a href=&quot;http://picasaweb.google.com/cgwalters/Screenshots/photo#5204819012288526178&quot;&gt;&lt;img src=&quot;http://lh4.ggpht.com/cgwalters/SDs7ULuoN2I/AAAAAAAABMI/g9R4IJd_bC4/s288/NM-Network-Available.png&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;i&gt;How to connect to a wireless network&lt;/i&gt;&lt;/center&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Cooking up the &lt;a href=&quot;http://bugzilla.gnome.org/show_bug.cgi?id=534427&quot;&gt;patch&lt;/a&gt; for that, I quickly ran into the problem though of notifications pointing to the wrong place.  If you&apos;ve used GNOME for long enough you probably know what I mean; on login sometimes getting a notification in the top left instead of the top right, or it could just be off by 10 pixels.  This usually wasn&apos;t too bad because the notification was more about the content, but in this case a notification pointing to the wrong thing was actually &lt;i&gt;worse&lt;/i&gt; than nothing.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Fixing this right ended up taking me though a number of layers in the stack, from the application displaying the notification, to libnotify, to &lt;a href=&quot;http://library.gnome.org/devel/pygtk/stable/class-gtkstatusicon.html&quot;&gt;GtkStatusIcon&lt;/a&gt;, to the &lt;a href=&quot;http://www.galago-project.org/specs/notification/0.9/index.html&quot;&gt;notification protocol&lt;/a&gt;, and finally to the notification daemon, which needed a fairly big &lt;a href=&quot;http://cdn.verbum.org/notification-daemon-combined-all.patch&quot;&gt;patch&lt;/a&gt;.  However after spending a bit of time this weekend I finally got it to work:&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;center&gt;&lt;a href=&quot;http://cdn.verbum.org/WorkingNotificationMovement.ogg&quot;&gt;&lt;img src=&quot;http://lh3.ggpht.com/cgwalters/SDtN87uoN3I/AAAAAAAABMU/20S8EPhUU1U/s288/WorkingNotificationMovement.png&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;i&gt;Link to Theora video&lt;/i&gt;&lt;/center&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Not earth shattering, but it has been a pretty longstanding bug in the desktop.  It was actually sort of fun to get back to grubbing around with the low level of &lt;a href=&quot;http://en.wikipedia.org/wiki/Xlib&quot;&gt;Xlib&lt;/a&gt;.&lt;/p&gt;</description>
  <comments>http://cgwalters.livejournal.com/17495.html</comments>
  <lj:security>public</lj:security>
</item>
<item>
  <guid isPermaLink='true'>http://cgwalters.livejournal.com/17292.html</guid>
  <pubDate>Sat, 10 May 2008 19:25:49 GMT</pubDate>
  <title>Polyglot programming</title>
  <link>http://cgwalters.livejournal.com/17292.html</link>
  <description>&lt;p&gt;As you may have gathered from &lt;a href=&quot;http://cgwalters.livejournal.com/14510.html&quot;&gt;previous&lt;/a&gt; &lt;a href=&quot;http://cgwalters.livejournal.com/16498.html&quot;&gt;entries&lt;/a&gt;, I&apos;ve recently become interested in programming languages again. &lt;br /&gt;I&apos;m almost done (though skimming some parts) with my copy of the aforementioned &lt;a href=&quot;http://www.amazon.com/Ruby-Programming-Language-David-Flanagan/dp/0596516177/ref=pd_bbs_sr_1?ie=UTF8&amp;amp;s=books&amp;amp;qid=1208370676&amp;amp;sr=8-1&quot;&gt;Ruby&lt;/a&gt; book. and though I haven&apos;t done any substantial Ruby programming (just playing around in &lt;a href=&quot;http://jruby.codehaus.org/The+JRuby+Tutorial+Part+1.5+-+Using+JIRB+to+Check+Java+Behaviour&quot;&gt;jirb&lt;/a&gt; while reading),  I think I have a good idea now why so many people love the language.&lt;/p&gt;&lt;br /&gt;&lt;h3&gt;Closures&lt;/h3&gt;&lt;br /&gt;&lt;p&gt;Most of my real code over the last number of years has been in C, Java, and Python, and I know those languages and their runtime libraries pretty well, but reading the Ruby book I was struck by how really useful &lt;a href=&quot;http://en.wikipedia.org/wiki/Closure_(computer_science)&quot;&gt;closures&lt;/a&gt; can be in an Algol-family language (i.e. not Lisp).  Well, Ruby calls them &quot;blocks&quot; and has infrastructure on top in the form of &lt;tt&gt;yield&lt;/tt&gt;, etc., but that&apos;s fundamentally what they are.   C/Java/Python all lack them (no, Python&apos;s single-line lambdas are too restrictive to count).  &lt;span style=&quot;float:right&quot;&gt;&lt;a href=&quot;http://flickr.com/photos/chris_wilson/167158347/&quot;&gt;&lt;img src=&quot;http://farm1.static.flickr.com/54/167158347_6b45c1ea96_m_d.jpg&quot;&gt;&lt;/img&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style=&quot;font-size: smaller&quot;&gt;&lt;i&gt;Closures...environment, get it?&lt;/i&gt;&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Closures are incredibly powerful, in fact you might say they&apos;re the &lt;a href=&quot;http://lambda-the-ultimate.org/&quot;&gt;ultimate&lt;/a&gt; language construct.  Neal Gafter has a &lt;a href=&quot;http://gafter.blogspot.com/2006/08/use-cases-for-closures.html&quot;&gt;good description&lt;/a&gt; of the kinds of things you can do with them, going from a language that doesn&apos;t currently have them.&lt;/p&gt;&lt;br /&gt;&lt;h3&gt;Polyglot programming&lt;/h3&gt;&lt;br /&gt;&lt;p&gt;While I was thinking about this blog entry, I reread one of Steve Yegge&apos;s &lt;a href=&quot;http://steve-yegge.blogspot.com/2007/12/codes-worst-enemy.html&quot;&gt;great blog posts&lt;/a&gt;, and decided to look up more about his reference to the author of a design pattern book &quot;leaving Java to go to Ruby&quot;.  After going to Martin&apos;s home page, I found on his wiki he has a &lt;a href=&quot;http://martinfowler.com/bliki/OneLanguage.html&quot;&gt;good entry&lt;/a&gt; which is pretty close to what I wanted to talk about.  That is basically: it makes sense for large software systems to have &lt;b&gt;multiple layers&lt;/b&gt; in different languages.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Now, if you&apos;re thinking &quot;Wow, that&apos;s obvious&quot;, that&apos;s good; but there is more to the story here.  So let&apos;s look at some rationales.  If your app is large enough, you probably have parts which need to be fast.  And you probably have other parts which cry out for a &lt;a href=&quot;http://en.wikipedia.org/wiki/Domain_Specific_Language&quot;&gt;domain-specific language&lt;/a&gt;.  &lt;a href=&quot;http://flickr.com/photos/juanillooo/343889648/&quot; style=&quot;float: left; margin: 10px&quot;&gt;&lt;img src=&quot;http://farm1.static.flickr.com/135/343889648_562e098b46_m_d.jpg&quot;&gt;&lt;/img&gt;&lt;/a&gt; &lt;/p&gt;&lt;br /&gt;&lt;p&gt;So for speed, you&apos;ll want a &lt;b&gt;lower layer&lt;/b&gt; which is usually characterized by manifest typing and direct &lt;a href=&quot;http://en.wikipedia.org/wiki/Vtable&quot;&gt;vtable&lt;/a&gt; function dispatch.  Read: C++/Java/C#.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;But it makes sense often to have a &lt;b&gt;higher layer&lt;/b&gt; which is agile.  It is better for the parts of your program which change rapidly - this could be user interface bits you&apos;re prototyping, or rapidly creating test cases.  This layer is usually characterized by implicit typing (possibly with type inference), &lt;a href=&quot;http://en.wikipedia.org/wiki/Metaprogramming&quot;&gt;metaprogramming&lt;/a&gt; capabilities, and (ideally) good integration with the lower level language.  Read: Groovy,JavaScript,Python,Ruby&lt;/p&gt;&lt;br /&gt;&lt;p&gt;There is a lot of software out there split in exactly this way; in fact, you&apos;re almost certainly reading this blog entry in one of them, &lt;a href=&quot;http://www.mozilla.com/en-US/firefox/&quot;&gt;Firefox&lt;/a&gt;, where the answer is C++ and JavaScript.  A lot of computer games are built in this way too - for &lt;a href=&quot;http://www.2kgames.com/civ4/home.htm&quot;&gt;Civilization 4&lt;/a&gt;, the answer is C++ and Python, and for World of Warcraft it&apos;s C++ and Lua.  If you&apos;re familiar with Java, just think about JSP and Ant - they&apos;re really DSLs.  If you mostly know Python or Ruby, think about how much of the underlying platform is actually written in C/Java/.NET.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;So it&apos;s fairly easy to dismiss anyone who says something like &quot;everything must be written in language X&quot;, for values of X like C,Ruby,Python,Java.  Which reminds me to say: &lt;a href=&quot;http://www.eclipse.org/&quot;&gt;Eclipse&lt;/a&gt; really needs to embrace &lt;a href=&quot;http://wiki.eclipse.org/Eclipse_Monkey_Overview&quot;&gt;Eclipse Monkey&lt;/a&gt;.&lt;/p&gt;&lt;br /&gt;&lt;h3&gt;The impedance mismatch&lt;/h3&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;&lt;a href=&quot;http://flickr.com/photos/cowlet/36528536/&quot; style=&quot;float: right&quot;&gt;&lt;img src=&quot;http://farm1.static.flickr.com/32/36528536_c2031cf228_m_d.jpg&quot;&gt;&lt;/a&gt;&lt;br /&gt;So we accept that it makes sense to have multiple languages with different characteristics.  One important issue then becomes - how similar are our two different layers?  Taking the example of C++ and Python as in Civilization 4.  The gap is &lt;b&gt;enormous&lt;/b&gt;.  C++ containers are not the same as Python containers.  C++ strings are not the same as Python strings.  C++ objects and Python objects are wildly different.  The answer to this problem is to create a special &lt;b&gt;glue layer&lt;/b&gt;; in Mozilla, it&apos;s called &lt;a href=&quot;http://developer.mozilla.org/en/docs/XPCOM&quot;&gt;XPCOM&lt;/a&gt;.  In GNOME, it&apos;s called &lt;a href=&quot;http://pygtk.org/&quot;&gt;pygobject&lt;/a&gt;.  These layers are very painful to create and maintain.&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;An interesting question is - what if our two languages shared more?  Do we really need to have separate container types just to get agility and dynamism?  The answer turns out to be - no, which we&apos;ll get to in a minute.  As we know, the fact that there are a lot of things that every modern language shares lower level components (like garbage collection, JIT compilation) led Microsoft to brand .NET as a multi-language runtime (as an aside, plenty of languages ran on the JVM long before .NET was created; for example &lt;a href=&quot;http://www.gnu.org/software/kawa/&quot;&gt;Kawa&lt;/a&gt;, which dates to 1996).  Now here&apos;s the thing, though.  Running on .NET does not make Python objects same as .NET objects, nor does it make their containers the same.&lt;/p&gt;&lt;br /&gt;&lt;h3&gt;What is an object?&lt;/h3&gt;&lt;br /&gt;&lt;p&gt;&lt;a href=&quot;http://flickr.com/photos/andreiz/351362235/&quot; style=&quot;float: right; margin: 10px&quot;&gt;&lt;img src=&quot;http://farm1.static.flickr.com/49/351362235_acedb81d17_m_d.jpg&quot;&gt;&lt;/img&gt;&lt;/a&gt; Let&apos;s briefly take a look at what a Python object is.  It&apos;s a fairly illustrative example of just how different languages can be.  In Python, every object instance is by default a dictionary (hash table), with data stored in the &lt;tt&gt;__dict__&lt;/tt&gt; member.  Every property lookup or method call has to in general traverse a chain of hash table lookups.  At any point, some other code can come along and add a new entry in an object&apos;s dictionary:&lt;/p&gt;&lt;br /&gt;&lt;pre&gt;
#!/usr/bin/python

class Test(object):
  def __init__(self, a):
    self.a = a

t = Test(&quot;hello&quot;)
t.b = 42
print t.b
&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;Supporting this level of dynamism is expensive, both in time and &lt;a href=&quot;http://blogs.gnome.org/zucchi/2008/05/10/linux-is-bloated/&quot;&gt;space&lt;/a&gt;, again because every object instance carries along a mutable hash table under the covers.  It means you can&apos;t share very much between processes.  It makes multi-threading much slower because everything has to be synchronized on that dictionary.  Besides being expensive, it&apos;s almost never what you actually want, at least by default.  You usually want t.b to be an error.  This is by far my biggest issue with Python.  In fairness to Python, it predates almost every other language discussed here.&lt;/p&gt;&lt;br /&gt;&lt;h3&gt;Stealing and language evolution&lt;/h3&gt;&lt;br /&gt;&lt;p&gt;&lt;a href=&quot;http://flickr.com/photos/artolog/212978551/&quot; style=&quot;margin: 10px; float: left&quot;&gt;&lt;img src=&quot;http://farm1.static.flickr.com/66/212978551_9facf253fb_m_d.jpg&quot;&gt;&lt;/img&gt;&lt;/a&gt;Languages are clearly stealing things from each other, and evolving together.  In the Ruby book they often mention how certain parts were taken from other languages.  Java and C# are stealing ideas from each other.  ECMAScript 4 is clearly rebuilding itself on a more JVM/.NET like class model.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;What I&apos;ve been looking at lately is a new dynamic language that has clearly stolen a lot of the good ideas from Ruby and Python, but is a lot more &quot;native&quot; to a modern runtime (in this case, the JVM): &lt;a href=&quot;http://groovy.codehaus.org/&quot;&gt;Groovy&lt;/a&gt;.&lt;/p&gt;&lt;br /&gt;&lt;pre&gt;
#!/usr/bin/env groovy

class Test {
  String a
}

def t = new Test(a: &quot;hello&quot;)
t.b = 42
println b
&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;&lt;img src=&quot;http://media.xircles.codehaus.org/_projects/groovy/_logos/medium.png&quot; style=&quot;float:right; margin: 10px;&quot;&gt;&lt;/img&gt; This results in an exception about a missing &lt;tt&gt;b&lt;/tt&gt;, because its idea of a &lt;tt&gt;class&lt;/tt&gt; is exactly the same as the underlying JVM platform, where objects are much more static by default (this is also true of .NET).  Note we can even declare types if we like (or we can just use &lt;tt&gt;def&lt;/tt&gt;).  I &lt;b&gt;really&lt;/b&gt; like how default constructors work - it&apos;s even less typing than both Python and Ruby!  It has &lt;a href=&quot;http://groovy.codehaus.org/Closures&quot;&gt;useful closures&lt;/a&gt;, regular expression and hash table literals.  Pretty cool.  For a more complex example, here&apos;s &lt;a href=&quot;http://svn.mugshot.org/dumbhippo/trunk/firehose/firehose/logstats.groovy&quot;&gt;an example&lt;/a&gt; of a fairly typical scripting task of log file processing I wrote a few days ago.  I&apos;m fairly sold so far, but there is still more to learn.  I spent a bit of spare time poking at getting it packaged, but ran into some Maven bootstrapping issues.&lt;/p&gt;&lt;br /&gt;&lt;h3&gt;More on languages&lt;/h3&gt;&lt;br /&gt;&lt;p&gt;One random link: An awesome feature of Python is &lt;a href=&quot;http://www.python.org/dev/peps/pep-0255/&quot;&gt;Generators&lt;/a&gt;, and if you aren&apos;t familiar with them and think of yourself as a &quot;systems programmer&quot;, check out this very good &lt;a href=&quot;http://www.dabeaz.com/generators/&quot;&gt;slide set&lt;/a&gt;.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Second to last: some recent additions to my Google Reader feed:  &lt;a href=&quot;http://headius.blogspot.com&quot;&gt;Charles Oliver Nutter&lt;/a&gt;, &lt;a href=&quot;http://blogs.sun.com/jrose&quot;&gt;John Rose&lt;/a&gt;, &lt;a href=&quot;http://lambda-the-ultimate.org/&quot;&gt;Lambda the Ultimate&lt;/a&gt;.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;As an aside that&apos;s not directly language related, but also new to my feed list is &lt;a href=&quot;http://hackety.org/&quot;&gt;Why&lt;/a&gt;, who is like a great artist-programmer churning out amazing works like &lt;a href=&quot;http://code.whytheluckystiff.net/shoes/&quot;&gt;Shoes&lt;/a&gt;.  Does anyone else have the feeling that for Why all of these code projects are just what he does in his idle time, and in the next few years he&apos;ll emerge from his underground hideout with an army of giant robots and take over the earth?&lt;/p&gt;&lt;/span&gt;</description>
  <comments>http://cgwalters.livejournal.com/17292.html</comments>
  <lj:security>public</lj:security>
</item>
<item>
  <guid isPermaLink='true'>http://cgwalters.livejournal.com/16940.html</guid>
  <pubDate>Fri, 09 May 2008 18:01:56 GMT</pubDate>
  <title>An even better OpenSSH interface</title>
  <link>http://cgwalters.livejournal.com/16940.html</link>
  <description>&lt;p&gt;As I&apos;ve mentioned before, in my spare time I&apos;ve been working on a fun &lt;a href=&quot;http://hotwire-shell.org/&quot;&gt;project&lt;/a&gt; to replace the Unix terminal and shell with native graphics and a high-level language runtime.   One thing that I quickly found out though was that certain applications require a real &lt;a href=&quot;http://en.wikipedia.org/wiki/VT100&quot;&gt;VT100&lt;/a&gt; terminal emulator; for example, &lt;tt&gt;less&lt;/tt&gt; is a highly optimized program, and while replacing it with a proper X11 app would be possible, it would not be trivial and would largely be a distraction from my goals anyways.  Another situation where you need a terminal emulator is connecting to remote Unix hosts; while I have complete control over the software on my laptop, it&apos;s hard to change all the existing servers out there.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;SSH in particular is something that really cries out for a nice application around it, rather than launching it primitively from an existing terminal emulator.  Earlier I &lt;a href=&quot;http://cgwalters.livejournal.com/10744.html&quot;&gt;mentioned&lt;/a&gt; the result of a few hours of PyGTK hacking.  Over the last week or two I&apos;ve been working on improving it.  Today &lt;a href=&quot;http://ascher.ca/blog/2008/05/09/contagious-user-interface-concepts/&quot;&gt;David Ascher&lt;/a&gt; of Thunderbird fame asked for it, so I should probably kick it out the door (though HotSSH is primarily for X11/Unix and not the Mac).&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;center&gt;&lt;a href=&quot;http://picasaweb.google.com/cgwalters/HotwireScreenshots/photo#5198437427206102050&quot;&gt;&lt;img src=&quot;http://lh4.ggpht.com/cgwalters/SCSPTCu3HCI/AAAAAAAABLQ/IhmiCRvtDag/s288/HotwireSSH-0201-1.png&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;i&gt;New connection with history&lt;/i&gt;&lt;/center&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;As you can see, the new version of HotSSH now &lt;i&gt;remembers&lt;/i&gt; what you do, automatically.  For example:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;If you connect to a host and use a custom username, the next time you open HotSSH and type the host again, it defaults to that custom username, without you having to do anything&lt;/li&gt;&lt;br /&gt;&lt;li&gt;It has pretty good completion on the Host entry, based both on ~/.ssh/known_hosts as well as its own history&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Open windows and tabs are saved automatically, Firefox style&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;p&gt;The only dependencies are CPython, GTK+, DBus, and OpenSSH.  I&apos;ve broken it out of where it previously lived in the Hotwire tarball into a separate source tarball.  You can currently get it from the &lt;a href=&quot;http://code.google.com/p/hotwire-shell/downloads/list&quot;&gt;Hotwire downloads&lt;/a&gt; page, though my long term plan is to import it into GNOME SVN and ideally have it come with GNOME out of the box.  The code is currently &lt;a href=&quot;http://code.google.com/p/hotwire-shell/source/browse/hotwire-ssh&quot;&gt;here&lt;/a&gt;, and bug reports &lt;a href=&quot;http://code.google.com/p/hotwire-shell/issues/list&quot;&gt;here&lt;/a&gt;.  It works well enough for me now; about all it might make sense to add is some sort of color scheme (we currently just pull from the gnome-terminal defaults).  To run, you can just unpack the tar and &lt;tt&gt;python ui/hotwire-ssh&lt;/tt&gt;.  If you install it, it should create a default &lt;tt&gt;bash&lt;/tt&gt; alias for &lt;tt&gt;ssh&lt;/tt&gt;, but this is something that package distributors will need to make sure integrates well.&lt;/p&gt;</description>
  <comments>http://cgwalters.livejournal.com/16940.html</comments>
  <lj:security>public</lj:security>
</item>
<item>
  <guid isPermaLink='true'>http://cgwalters.livejournal.com/16885.html</guid>
  <pubDate>Sat, 26 Apr 2008 17:44:00 GMT</pubDate>
  <title>How to share state with applications for Free Unix-based desktops</title>
  <link>http://cgwalters.livejournal.com/16885.html</link>
  <description>&lt;p&gt;So you&apos;re writing an application.  At some point, you have a problem where you want to be able to talk to an instance of your program while it&apos;s running.  It turns out, this is fiendishly difficult for Free Unix-based desktops, and &lt;i&gt;many&lt;/i&gt; programs get it wrong.  On my Fedora 9 system, looking in &lt;tt&gt;/tmp&lt;/tt&gt;, I see listings like &lt;tt&gt;gconfd-walters&lt;/tt&gt; (GConf), &lt;tt&gt;hsperfdata_walters&lt;/tt&gt; (OpenJDK), &lt;tt&gt;pulse-walters&lt;/tt&gt; (Pulseaudio), &lt;tt&gt;emacs500&lt;/tt&gt; (GNU Emacs).  All of these programs are broken.  The root cause of this is the failure of Unix to provide a &lt;i&gt;standard per-user, per-machine&lt;/i&gt; temporary directory.  If we had that, things would be dramatically simpler, but we don&apos;t.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;You can&apos;t use &lt;tt&gt;/tmp&lt;/tt&gt; because it&apos;s not per-user.  Any time you rely on a well-known name in &lt;tt&gt;/tmp&lt;/tt&gt; (like the above list), your application is subject to denial-of-service attacks if another user creates that file before you log in.  Security aside, it&apos;s also just harder to deal with because you have to check for whether or not the data in your temporary directory is stale or not (is something listening on that socket, or is it left over from a session crash?), and that&apos;s yet more painful code.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;You can&apos;t use &lt;tt&gt;$HOME&lt;/tt&gt; because it&apos;s not per-machine (think of all the sites that subject users to the pain of NFS), and won&apos;t always support Unix domain socket files.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Now, there are other solutions; you can use the X server, which is what Firefox does I believe. If your application is single-instance this isn&apos;t too bad, but there is an easier way:&lt;/p&gt;&lt;br /&gt;&lt;h3&gt;Enter solution: DBus&lt;/h3&gt;&lt;br /&gt;&lt;p&gt;The best solution is to use &lt;a href=&quot;http://www.freedesktop.org/wiki/Software/dbus&quot;&gt;DBus&lt;/a&gt;.  The key feature here is that the DBus session bus provides exactly what we want: a per-user, per-machine namespace, as well as a fairly sane IPC system we can use to pass messages.  Here&apos;s how you use it.&lt;/p&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;Decide on a &lt;tt&gt;service name&lt;/tt&gt; for your application.  For the purposes of this discussion, we&apos;ll call it &lt;tt&gt;org.openssh.Ssh&lt;/tt&gt;, for no particular reason.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;In your application startup, try to acquire this name on the session bus, using DBus.  If you&apos;re successful, your application can now provide a service.  To pick a completely random example, this service might be multiplexing SSH connections.  If something else already owns the service, then you can act as a client; you might send the message &lt;tt&gt;org.openssh.GetControlMasterSocketPath&lt;/tt&gt; to return the path to another Unix-domain socket, because your application has a non-DBus protocol for communication.&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;p&gt;In this example, we just used DBus to retrieve the path to another local, randomly-named Unix domain socket.  That&apos;s perfectly fine - DBus is not the one true IPC system.  Programs like Pulseaudio and OpenSSH already have defined protocols, and there is nothing wrong with that, we don&apos;t need to replace them with DBus.  However, DBus is the best candidate for a one true atomic session namespace.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Again, all examples used in this blog post are completely hypothetical, and have no relation to the silliness of requiring users to try to hack around this issue on their own computers with variables like &lt;tt&gt;ControlMaster&lt;/tt&gt; and &lt;tt&gt;ControlPath&lt;/tt&gt; to enable a useful feature of your application.&lt;/p&gt;</description>
  <comments>http://cgwalters.livejournal.com/16885.html</comments>
  <lj:security>public</lj:security>
</item>
<item>
  <guid isPermaLink='true'>http://cgwalters.livejournal.com/16498.html</guid>
  <pubDate>Mon, 21 Apr 2008 16:44:00 GMT</pubDate>
  <title>OK Internet, I concede</title>
  <link>http://cgwalters.livejournal.com/16498.html</link>
  <description>&lt;p&gt;I&apos;m going to learn Ruby.  My copy of &lt;a href=&quot;http://www.amazon.com/Ruby-Programming-Language-David-Flanagan/dp/0596516177/ref=pd_bbs_sr_1?ie=UTF8&amp;amp;s=books&amp;amp;qid=1208370676&amp;amp;sr=8-1&quot;&gt;The Ruby Programming Language&lt;/a&gt; arrives today.&lt;/p&gt;</description>
  <comments>http://cgwalters.livejournal.com/16498.html</comments>
  <lj:security>public</lj:security>
</item>
<item>
  <guid isPermaLink='true'>http://cgwalters.livejournal.com/16221.html</guid>
  <pubDate>Tue, 15 Apr 2008 21:47:10 GMT</pubDate>
  <title>Cute..</title>
  <link>http://cgwalters.livejournal.com/16221.html</link>
  <description>&lt;p&gt;I see from this history meme that a lot of people are still using prehistoric shells!  Low numbers like &lt;a href=&quot;http://www.michaeldehaan.net/?p=583&quot;&gt;303&lt;/a&gt; or even &lt;a href=&quot;http://www.ardisson.org/afkar/2008/04/15/counting-commands/&quot;&gt;24&lt;/a&gt; total times for top execution?  Now, &lt;a href=&quot;http://hotwire-shell.org/&quot;&gt;my shell&lt;/a&gt; knows how to store data &lt;a href=&quot;http://www.sqlite.org/&quot;&gt;properly&lt;/a&gt;, so for example it doesn&apos;t toss away your entire session if you don&apos;t exit it cleanly, and has scaled so far with near-instant searches for a 20000+ history size.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;My code:&lt;/p&gt;&lt;br /&gt;&lt;pre&gt;
import os,sys,sqlite3
c = sqlite3.connect(os.path.expanduser(&apos;~/.hotwire/state/history.sqlite&apos;))
cmds = map(lambda x: x[0].split(&apos; &apos;, 1)[0], c.execute(&apos;SELECT cmd FROM Commands&apos;))
stats = {}
for cmd in cmds:
  count = stats.get(cmd, 0)
  stats[cmd] = count+1
cmds = stats.keys()
cmds.sort(lambda a,b: cmp(stats[b],stats[a]))
for cmd in cmds:
  print &quot;%s: %s&quot; % (cmd, stats[cmd])
&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;Output:&lt;/p&gt;&lt;br /&gt;&lt;pre&gt;
cd: 2280
ls: 2003
ed: 1823
git: 1362
python: 1187
make: 817
svn: 751
sudo: 669
py: 543
cat: 442
rpm: 380
rm: 370
less: 366
cvs: 306
&lt;/pre&gt;</description>
  <comments>http://cgwalters.livejournal.com/16221.html</comments>
  <lj:security>public</lj:security>
</item>
<item>
  <guid isPermaLink='true'>http://cgwalters.livejournal.com/16006.html</guid>
  <pubDate>Fri, 11 Apr 2008 15:44:02 GMT</pubDate>
  <title>Various</title>
  <link>http://cgwalters.livejournal.com/16006.html</link>
  <description>&lt;h3&gt;Mailing lists&lt;/h3&gt;&lt;br /&gt;&lt;p&gt;&lt;a href=&quot;http://blogs.gnome.org/otte/2008/04/07/open-source-will-scale/&quot;&gt;Benjamin discovers&lt;/a&gt; that yes, pretty much no one except hardcore hackers use mailing lists (my thoughts on them &lt;a href=&quot;http://cgwalters.livejournal.com/2796.html&quot;&gt;here&lt;/a&gt;).  I don&apos;t see the disconnect between normal users and developers as &quot;scaling&quot; - it&apos;s not a good thing.  I&apos;ll try to look at &lt;a href=&quot;http://forums.fedoraforum.org/&quot;&gt;Fedora Forum&lt;/a&gt; more...must train self to ignore the flashing &quot;NEW&quot; icon.&lt;/p&gt;&lt;br /&gt;&lt;h3&gt;New journal&lt;/h3&gt;&lt;br /&gt;&lt;p&gt;I spent a little bit of free time a few days ago to make the &lt;a href=&quot;https://addons.mozilla.org/en-US/firefox/addon/6744&quot;&gt;Firefox Journal&lt;/a&gt; extension work again.  As mentioned before, you&apos;ll need to create an AMO account to install because it&apos;s still in the &quot;sandbox&quot;.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Now it needs some CSS love for sure.  But, it works and I find it pretty useful for a few tasks, such as &quot;go back to that new bug I was looking at 10 minutes ago&quot;.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Speaking of extensions...&lt;a href=&quot;https://addons.mozilla.org/en-US/firefox/addon/469&quot;&gt;Password Maker&lt;/a&gt; is &lt;i&gt;awesome&lt;/i&gt;.  I&apos;ve now redone most of my web passwords using it.&lt;/p&gt;&lt;br /&gt;&lt;h3&gt;Account system&lt;/h3&gt;&lt;br /&gt;&lt;p&gt;I&apos;ve been thinking lately about how to improve the online.gnome.org account system.  If you&apos;re curious, my proposal is linked &lt;a href=&quot;http://mail.gnome.org/archives/online-desktop-list/2008-April/msg00069.html&quot;&gt;from here&lt;/a&gt;&lt;br /&gt;&lt;h3&gt;Languages&lt;/h3&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;a href=&quot;http://clojure.sourceforge.net/&quot;&gt;Clojure&lt;/a&gt; definitely shows that there is a lot of room left for innovation in programming languages.  I&apos;d only briefly heard of &lt;a href=&quot;http://clojure.sourceforge.net/reference/refs.html&quot;&gt;transactional memory&lt;/a&gt; before; this is something to learn.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href=&quot;http://www.ecmascript.org/&quot;&gt;ECMAScript 4&lt;/a&gt; looks like a massive improvement over the old JavaScript.  I, for one, will not miss the old bizarre &lt;tt&gt;prototype&lt;/tt&gt; system.  &lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;p&gt;A &lt;a href=&quot;http://andigutmans.blogspot.com/2008/03/java-is-losing-battle-for-modern-web.html&quot;&gt;good post&lt;/a&gt; by one of the PHP authors on dynamic vs static languages (though he phrases it as Ruby/Python/PHP vs Java).  I think my feelings on this lately are that if I were going to work on a website frontend process, it makes total sense to use Ruby or Python.  But there&apos;s a lot more to the world than website frontends.  For example, I don&apos;t think I would choose a dynamic language to write &lt;a href=&quot;http://hadoop.apache.org/core/&quot;&gt;Hadoop&lt;/a&gt; or HDFS.  The dynamic vs static debate is of course a very old one, but what &lt;b&gt;is&lt;/b&gt; new is the dramatic progress of dynamic languages on VMs designed for static languages, which I was &lt;a href=&quot;http://cgwalters.livejournal.com/14510.html&quot;&gt;playing with&lt;/a&gt; before.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;What I think people in these debates &lt;i&gt;greatly underestimate&lt;/i&gt; though is the importance and power of the Free Software ecosystem, which could also be called the &quot;default factor&quot;.  &lt;tt&gt;/usr/bin/ruby&lt;/tt&gt; has always been a simple yum/apt-get install away on Free operating systems if it wasn&apos;t already there; no license clickthrough web pages.  That matters.&lt;/p&gt;&lt;br /&gt;&lt;h3&gt;It&apos;s the community, stupid&lt;/h3&gt;&lt;br /&gt;&lt;p&gt;Speaking of technology though, a lot of us sysadmins, programmers and free software hackers can get easily get caught up in the implementation details of our systems.  Now for sure, some things are just technically better than others; for example, the JVM is years ahead of CRuby&apos;s green threads and basic bytecode interpreter.  But what ultimately matters is the people behind the technology.  It&apos;s easy to get confused because the technology names are staring us in the face; when you want to run your program, you type &lt;tt&gt;/usr/bin/ruby&lt;/tt&gt;, and not &lt;tt&gt;/usr/bin/a-language-from-matz-and-and-now-a-global-community&lt;/tt&gt;.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;A key example where I see this happen often is in &quot;packaging systems&quot;; many people confuse the program &lt;tt&gt;apt-get&lt;/tt&gt;, which is just an overgrown &lt;tt&gt;wget&lt;/tt&gt;, with all the hard work that goes into packaging and maintaining software.  In the beginning, people had to go through and make sure it worked.  For certain types of software, it is actually hard and there&apos;s no getting around it; an example is &lt;a href=&quot;https://bugzilla.redhat.com/show_bug.cgi?id=436036&quot;&gt;JNA&lt;/a&gt; which deals with some lower-level JVM access.  In that case, a lot of the work was done by two Fedora community members.  And we even sent the patch for our work upstream, so that all Free operating systems can benefit.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Anyways, that&apos;s enough for a Friday pre-lunch update...&lt;/p&gt;</description>
  <comments>http://cgwalters.livejournal.com/16006.html</comments>
  <lj:security>public</lj:security>
</item>
<item>
  <guid isPermaLink='true'>http://cgwalters.livejournal.com/15789.html</guid>
  <pubDate>Wed, 09 Apr 2008 16:27:10 GMT</pubDate>
  <title>ToolKit</title>
  <link>http://cgwalters.livejournal.com/15789.html</link>
  <description>&lt;blockquote&gt;&quot;What it lacks is an extensive screen reader like GNOME&apos;s Orca&quot;: Do you really think our time is best spent spending time reimplementing Orca just so we have something in Qt? Maybe someday someone will, but right now we have better things to do. This kind of mentality of &quot;my toolkit or DIE!&quot; is a disease. It makes us waste more effort and time when it isn&apos;t specifically needed. In this case, just use Orca with KDE4 apps.&lt;br /&gt;  -- &lt;a href=&quot;http://aseigo.blogspot.com/2008/04/re-nine-improvements-needed-in-kde-by.html&quot;&gt;Aaron Segio&lt;/a&gt;.&lt;/blockquote&gt;&lt;br /&gt;&lt;p&gt;Agreed! -- Colin, who is currently using the official Last.fm client written in Qt because, hey it worked, and it&apos;s Free Software.&lt;/p&gt;</description>
  <comments>http://cgwalters.livejournal.com/15789.html</comments>
  <lj:security>public</lj:security>
</item>
<item>
  <guid isPermaLink='true'>http://cgwalters.livejournal.com/15512.html</guid>
  <pubDate>Wed, 02 Apr 2008 14:36:42 GMT</pubDate>
  <title>On standards</title>
  <link>http://cgwalters.livejournal.com/15512.html</link>
  <description>&lt;p&gt;&lt;a href=&quot;http://bjacob.livejournal.com/5086.html&quot;&gt;Very good&lt;/a&gt; post I saw while scanning Planet KDE.  Which reminds me - besides keeping up with what&apos;s happening in KDE via their planet, other recent additions to my feed list are &lt;a href=&quot;http://steve-yegge.blogspot.com/&quot;&gt;Stevey&apos;s Blog Rants&lt;/a&gt; and the &lt;a href=&quot;http://developer.yahoo.com/blogs/hadoop/&quot;&gt;Hadoop&lt;/a&gt; blog.&lt;/p&gt;</description>
  <comments>http://cgwalters.livejournal.com/15512.html</comments>
  <lj:security>public</lj:security>
</item>
<item>
  <guid isPermaLink='true'>http://cgwalters.livejournal.com/15345.html</guid>
  <pubDate>Thu, 27 Mar 2008 17:51:17 GMT</pubDate>
  <title>A perhaps less controversial plan for creating a better VM</title>
  <link>http://cgwalters.livejournal.com/15345.html</link>
  <description>&lt;p&gt;The previous post spawned a lot of discussion, a lot of which was surprisingly technical and on-topic.  But after talking with some people I realized that OpenJDK can do a lot just on its own.  Here&apos;s my wishlist:&lt;/p&gt;&lt;br /&gt;&lt;h3&gt;OpenJDK-&amp;gt;OpenVM plan&lt;/h3&gt;&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;&lt;li&gt;Split up source distribution into OpenVM core, place things like Swing into separate source project&lt;/li&gt;&lt;br /&gt;&lt;li&gt;OS-specific integration in core; e.g. javax.unix namespace (e.g. Unix domain sockets), javax.windows (similar to python-win32), javax.osx; and allow interested operating system vendors to innovate there.  The operating system &lt;b&gt;does&lt;/b&gt; matter.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Commit to longer-term VM improvements necessary to allow compilation of C# into extended JVM bytecode (not CIL)&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Commit to VM improvements necessary to make Jython/JRuby work well&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Stay on top of Linux distribution integration, make sure packagers aren&apos;t carrying patches (this includes JSR 277 work)&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Together with the above, branding as OpenVM or something similar to express willingness to be more than just the old &quot;Java&quot; which was JVM+Java language+Swing&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;</description>
  <comments>http://cgwalters.livejournal.com/15345.html</comments>
  <lj:security>public</lj:security>
</item>
<item>
  <guid isPermaLink='true'>http://cgwalters.livejournal.com/14913.html</guid>
  <pubDate>Tue, 25 Mar 2008 17:25:53 GMT</pubDate>
  <title>An Open Letter to Jonathan Schwartz and Miguel de Icaza</title>
  <link>http://cgwalters.livejournal.com/14913.html</link>
  <description>&lt;p&gt;&lt;br /&gt;Jonathan, you are leading the development of a Free Software, high-quality, multi-language VM runtime with an extensive class library, called OpenJDK.&lt;br /&gt;&lt;br /&gt;Miguel, you are leading the development of a Free Software, high-quality, multi-language VM runtime with an extensive class library, called Mono.&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;How about a merge?  We&apos;ll call the new project &quot;OpenVM&quot;, for convenience in this letter.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Let&apos;s jump right in to the advantages for the projects:&lt;/p&gt;&lt;br /&gt;&lt;h3&gt;Advantages for Mono&lt;/h3&gt;&lt;br /&gt;&lt;p&gt;In one word - &lt;i&gt;control&lt;/i&gt;.  Miguel, your original goal with Mono was to bring a modern &lt;b&gt;and&lt;/b&gt; Free Software development stack to GNOME and Linux.  In many respects, you and the Mono community have been succeesful, helping spur the creation useful applications for the Free desktop, as well as getting Mono deployed in interesting applications like Second Life.  However, you are largely not in control of your destiny.   You&apos;re stuck implementing a clone of what Microsoft creates, and besides the fact that cloning something is &lt;a href=&quot;http://jeffreystedfast.blogspot.com/2008/03/moonlight-text-rendering.html&quot;&gt;much less fun&lt;/a&gt; for your engineers, you can&apos;t help but be behind.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;By helping to create the OpenVM project, you will regain control.  In an OpenVM effort, drawing on the common shared work of several corporations (Sun, Novell, Red Hat, Google, and IBM, to name a few), your engineers get to help design the future of Free Software.  You will instantly remove all hesitation that the Free Software community has about your work, and have been the a key part of not one but two cornerstone projects for Free Software (GNOME, and Mono-&amp;gt;OpenVM).&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;h3&gt;Advantages for OpenJDK&lt;/h3&gt;&lt;br /&gt;&lt;p&gt;Jonathan, you have said you want to take the &lt;a href=&quot;http://java.dzone.com/news/farewell-j-jvm&quot;&gt;J out of JVM&lt;/a&gt;.  By stepping up and adding Mono technology like a high quality C# compiler to this OpenVM effort, in the short term you will regain the eroding market share of the JVM on Windows by allowing interoperability between the growing C# code base and existing Java code. In the longer term, developer attraction to OpenVM will let you accelerate improvements to Java, and reverse gains in C# market share.&lt;br /&gt;Moreover, the community agile languages such as Ruby and Python are nearly certain to join an OpenVM effort.  Your company will again be at the core of the stack for the vast majority of the computing industry, from the Free Software community to the proprietary applications.&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;From the Free Software side, turning Mono from a Microsoft technology clone into a part of a truly Free project would eliminate the increasing use of .NET in the community.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Finally, leveraging the Mono team would bring a number of excellent engineers who know the Free desktop very well, having created high-quality bindings for GNOME, and Free applications that many people use.&lt;/p&gt;&lt;br /&gt;&lt;h3&gt;Advantages for the Free Software community&lt;/h3&gt;&lt;br /&gt;&lt;p&gt;The Free Software community has long been split between developers using Free and agile languages like Ruby and Python, the the Mono-based community, and a huge community of developers in the world who used in the formerly-proprietary Java in Free projects like Apache.  A combined OpenJDK and Mono would dramatically further the merge of all three of these communities, increasing the control the Free Software community has over the stack and reducing duplication of HTTP libraries, database access libraries, etc.&lt;/p&gt;&lt;br /&gt;&lt;h3&gt;Details&lt;/h3&gt;&lt;br /&gt;&lt;p&gt;Obviously, there would be many details to work out in such an effort, like how the class libraries could be merged.  My intuition is that initially OpenVM would have both JDK and .NET &quot;personalities&quot;.  Over time, the Mono .NET class library would be rebased on top of an evolved JDK class library, and eventually the .NET personality could be relegated to a separate &quot;OpenVM-.NET emulation&quot; project as most applications are ported to use the OpenVM JDK-based class library.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;But the details are just that - where there&apos;s a will there is a way.  So the open question is - who will register the domain name first?&lt;/p&gt;</description>
  <comments>http://cgwalters.livejournal.com/14913.html</comments>
  <lj:security>public</lj:security>
</item>
<item>
  <guid isPermaLink='true'>http://cgwalters.livejournal.com/14660.html</guid>
  <pubDate>Sun, 23 Mar 2008 19:55:27 GMT</pubDate>
  <title>Hotwire hypershell 0.721 released</title>
  <link>http://cgwalters.livejournal.com/14660.html</link>
  <description>&lt;p&gt;&lt;a href=&quot;http://hotwire-shell.org&quot;&gt;Hotwire&lt;/a&gt; 0.721 is now &lt;a href=&quot;http://code.google.com/p/hotwire-shell/downloads/list&quot;&gt;available&lt;/a&gt;. This release features a lot of changes since 0.710.  Immediately visible will be the entirely revamped UI.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;center&gt;&lt;br /&gt;&lt;a href=&quot;http://picasaweb.google.com/cgwalters/HotwireScreenshots/photo#5181023685350357202&quot;&gt;&lt;img src=&quot;http://lh3.google.com/cgwalters/R-axl3IxeNI/AAAAAAAABJM/vCPB-l5mxZw/s288/Screenshot-Hotwire.png&quot; /&gt;&lt;/a&gt;&lt;br&gt;&lt;i&gt;New Hotwire 0.721 UI&lt;/i&gt;&lt;br /&gt;&lt;/center&gt;&lt;br /&gt;&lt;center&gt;&lt;br /&gt;&lt;a href=&quot;http://picasaweb.google.com/cgwalters/HotwireScreenshots/photo#5181024114847086818&quot;&gt;&lt;img src=&quot;http://lh3.google.com/cgwalters/R-ax-3IxeOI/AAAAAAAABJY/6eecRrUPqSw/s288/Screenshot-Hotwire-full.png&quot; /&gt;&lt;/a&gt;&lt;br&gt;&lt;i&gt;Full screenshot with object inspector&lt;/i&gt;&lt;/center&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;The goal is to be closer to a shell/terminal interface than before, giving more space to the output of commands while still allowing use of the mouse for operations.  Another exciting internal change is that you can now define Hotwire builtins as regular Python functions, but with a decorator.  For more about this feature, see &lt;a href=&quot;http://groups.google.com/group/hotwire-shell/browse_thread/thread/333f810bf338079d?hl=en&quot;&gt;this post&lt;/a&gt;.&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;Besides the above, there are a lot of other nice changes in this release from a growing list of patch contributors, such as Zeng.Shixin&apos;s contribution of native file icons for Win32:&lt;/p&gt;&lt;br /&gt;&lt;center&gt;&lt;br /&gt;&lt;a href=&quot;http://picasaweb.google.com/cgwalters/HotwireScreenshots/photo#5181025055444924658&quot;&gt;&lt;img src=&quot;http://lh6.google.com/cgwalters/R-ay1nIxePI/AAAAAAAABJk/SHfFND59Ayc/s288/native_icons.png&quot; /&gt;&lt;/a&gt;&lt;br&gt;&lt;i&gt;Native Icons on Win32&lt;/i&gt;&lt;br /&gt;&lt;/center&gt;&lt;br /&gt;&lt;p&gt;As well as Chris Mason&apos;s improvements to the command output search:&lt;/p&gt;&lt;br /&gt;&lt;center&gt;&lt;br /&gt;&lt;a href=&quot;http://picasaweb.google.com/cgwalters/HotwireScreenshots/photo#5181025665330280706&quot;&gt;&lt;img src=&quot;http://lh4.google.com/cgwalters/R-azZHIxeQI/AAAAAAAABJw/ecjdN18vS5o/s288/Screenshot-Hotwire-searchhighlight.png&quot; /&gt;&lt;/a&gt;&lt;br&gt;&lt;i&gt;Search highlighting&lt;/i&gt;&lt;br /&gt;&lt;/center&gt;&lt;br /&gt;&lt;p&gt;I added a nicer connection status display to the included Unix SSH client:&lt;/p&gt;&lt;br /&gt;&lt;center&gt;&lt;br /&gt;&lt;a href=&quot;http://picasaweb.google.com/cgwalters/HotwireScreenshots/photo#5181027568000792850&quot;&gt;&lt;img src=&quot;http://lh3.google.com/cgwalters/R-a1H3IxeRI/AAAAAAAABJ8/nIiq6s9ccZw/s288/Screenshot-HotSSH-connection.png&quot; /&gt;&lt;/a&gt;&lt;br&gt;&lt;i&gt;Connection status display in HotSSH&lt;/i&gt;&lt;br /&gt;&lt;/center&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Mark Williamson has been experimenting with a set of Hotwire extensions to make Hotwire into an interactive Mercurial shell; see &lt;a href=&quot;http://www.cl.cam.ac.uk/~maw48/hotwire-hg/&quot;&gt;his site&lt;/a&gt;.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;For the detailed release email, see &lt;a href=&quot;http://groups.google.com/group/hotwire-shell/browse_thread/thread/f8e91b5833bac00?hl=en&quot;&gt;the announcement&lt;/a&gt;.&lt;/p&gt;</description>
  <comments>http://cgwalters.livejournal.com/14660.html</comments>
  <category>hotwire</category>
  <lj:security>public</lj:security>
</item>
<item>
  <guid isPermaLink='true'>http://cgwalters.livejournal.com/14510.html</guid>
  <pubDate>Sun, 23 Mar 2008 15:38:49 GMT</pubDate>
  <title>Four languages - one process</title>
  <link>http://cgwalters.livejournal.com/14510.html</link>
  <description>&lt;p&gt;The &lt;a href=&quot;http://cgwalters.livejournal.com/14310.html&quot;&gt;previous entry&lt;/a&gt; was cut slightly short because I had to head out to dinner.  What I was trying to finish was a bit of code to experiment with JRuby, Jython, Rhino, and the new &lt;a href=&quot;https://scripting.dev.java.net/&quot;&gt;JSR 223&lt;/a&gt; scripting framework.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;My first step was to build JRuby from trunk and the &lt;a href=&quot;https://jython.svn.sourceforge.net/svnroot/jython/branches/py25/&quot;&gt;Jython 2.5 branch&lt;/a&gt;, as well as JSR223 trunk.  After a &lt;a href=&quot;https://scripting.dev.java.net/issues/show_bug.cgi?id=30&quot;&gt;small patch&lt;/a&gt;, I got some code working:&lt;/p&gt;&lt;br /&gt;&lt;pre&gt;
package org.verbum;

import javax.script.ScriptContext;
import javax.script.ScriptEngine;
import javax.script.ScriptEngineManager;
import javax.script.ScriptException;
import javax.script.SimpleScriptContext;

public class LangFun {
  public static class Hello {
    public void sayHello() {
      System.out.println(&quot;Hello world!&quot;);
    }
  }
  public static void main(String[] args) throws ScriptException {
    ScriptEngineManager mgr = new ScriptEngineManager();
        
    Hello greeting = new Hello();
        
    greeting.sayHello();
      
    ScriptContext context = new SimpleScriptContext();
    context.setAttribute(&quot;greeting&quot;, greeting, ScriptContext.ENGINE_SCOPE);          
        
    ScriptEngine javaScript = mgr.getEngineByExtension(&quot;js&quot;);
    javaScript.setContext(context);
    javaScript.eval(&quot;greeting.sayHello()&quot;);
       
    ScriptEngine ruby = mgr.getEngineByExtension(&quot;rb&quot;);
    ruby.setContext(context);
    ruby.eval(&quot;$greeting.sayHello&quot;);
        
    ScriptEngine python = mgr.getEngineByExtension(&quot;py&quot;);
    python.setContext(context);
    python.eval(&quot;greeting.sayHello()&quot;);        
  }
}
&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;To run this, you&apos;ll need to link to &lt;tt&gt;jruby.jar&lt;/tt&gt;, &lt;tt&gt;jython.jar&lt;/tt&gt;, &lt;tt&gt;rhino.jar&lt;/tt&gt;, as well as the respective engines from JSR223: &lt;tt&gt;jruby-engine.jar&lt;/tt&gt;, &lt;tt&gt;jython-engine.jar&lt;/tt&gt;, &lt;tt&gt;js-engine.jar&lt;/tt&gt;.&lt;br /&gt;The idea behind this code is pretty simple - we first create a Java object, with a single method.  Then we use the JSR223 interface to instantiate an engine for each of the languages, hook up a context object which maps the variable &lt;tt&gt;greeting&lt;/tt&gt; into the global namespace for each language, then call their respective &lt;tt&gt;eval&lt;/tt&gt; methods.  The result is what you&apos;d expect:&lt;/p&gt;&lt;br /&gt;&lt;pre&gt;
Hello world!
Hello world!
Hello world!
Hello world!
&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;Pretty cool!  Of course, I&apos;m not really stressing the system here with these simple scripts; but given the &lt;a href=&quot;http://www.ohloh.net/projects/423/analyses/latest&quot;&gt;dramatic progress&lt;/a&gt; (really, look at that graph!) of projects like JRuby, the future approaching very quickly.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&quot;Ok, but...&quot;, you might say, &quot;what&apos;s this useful for besides sharing libraries?&quot;  The general answer is that the single process, shared memory model is fundamentally more powerful than the multi-process, communicating over bytestream pipes model.  You can just do more, with fewer hacks.  An example is software like &lt;a href=&quot;http://www.reinteract.org/trac/&quot;&gt;Reinteract&lt;/a&gt; - before, it could only support Python.  Now, not only could you add an input language chooser to Reinteract; you could actually pass the results from a Python computation increasingly seamlessly into Groovy, Java, or whatever.  Personally, I specifically want this for &lt;a href=&quot;http://hotwire-shell.org/&quot;&gt;Hotwire&lt;/a&gt;.  Right now we only support Python well, because the project is based on CPython.&lt;/p&gt;&lt;br /&gt;&lt;h3&gt;Many new languages for the Free Software community&lt;/h3&gt;&lt;br /&gt;&lt;p&gt;There was a comment on the last entry mentioning &lt;a href=&quot;http://www.scala-lang.org/&quot;&gt;Scala&lt;/a&gt;.  I&apos;ve only looked at it very briefly.  But this is just one of many languages that are now truly, finally part of the Free Software community.  The &lt;a href=&quot;https://scripting.dev.java.net/&quot;&gt;Scripting&lt;/a&gt; project has a list of the engines written.  But that list is far from complete, because some don&apos;t have the engine glue written yet, and because other languages like Scala are more designed as Java replacements that run on the JVM, rather than &quot;scripting&quot;.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;And of course through all of this, venerable Java isn&apos;t standing still - it will likely gain &lt;a href=&quot;http://www.javac.info/&quot;&gt;closures&lt;/a&gt;.  And remember - all of this will soon be available (if it isn&apos;t already) via &lt;tt&gt;yum install&lt;/tt&gt; or &lt;tt&gt;apt-get install&lt;/tt&gt;, etc., all of it entirely Free Software, and increasingly integrated with the operating system and your &lt;a href=&quot;http://java-gnome.sourceforge.net/&quot;&gt;favorite libraries&lt;/a&gt;.&lt;/p&gt;</description>
  <comments>http://cgwalters.livejournal.com/14510.html</comments>
  <lj:security>public</lj:security>
</item>
<item>
  <guid isPermaLink='true'>http://cgwalters.livejournal.com/14310.html</guid>
  <pubDate>Sat, 22 Mar 2008 22:43:09 GMT</pubDate>
  <title>A software tsunami</title>
  <link>http://cgwalters.livejournal.com/14310.html</link>
  <description>A large underwater &lt;a href=&quot;http://en.wikipedia.org/wiki/Earthquake&quot;&gt;earthquake&lt;/a&gt; ends up creating an effect called a &lt;a href=&quot;http://en.wikipedia.org/wiki/Tsunami&quot;&gt;tsunami&lt;/a&gt;.  The event can be detected by sensors around the world, but the resulting tsunami isn&apos;t immediately visible; if you&apos;re in the surrounding ocean you&apos;ll notice it, but it&apos;s only when it hits land that you really notice the effect.&lt;br /&gt;&lt;p&gt;&lt;br /&gt;On May 8, 2007, there was an effect a lot like an underwater earthquake in the software world.  What are we talking about?  The complete release of &lt;a href=&quot;http://openjdk.java.net/&quot;&gt;OpenJDK&lt;/a&gt;, of course.  Since that time, we&apos;ve mostly been in the underwater propagation stage.  A lot has been happening behind the scenes such as removing proprietary bits, &lt;a href=&quot;http://fitzsim.org/blog/?p=19&quot;&gt;fixing OS integration&lt;/a&gt;, etc.  But now, I think we&apos;re close to moving into the stage where the ocean recedes, so you can see the first visible effects.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;The original OpenJDK release was a snapshot of the in-development version 7, so it was not quite suitable as a drop-in replacement for software that was targeting JDK 6.   But recently in February, Sun released the sources to the stable version of the JDK, version 6.  Thanks to the combined work of the OpenJDK team and the IcedTea project, this is now suitable to effectively work as a drop-in replacement for the earlier proprietary JDK releases.&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;On Fedora 8, this command worked for me:&lt;/p&gt;&lt;br /&gt;&lt;pre&gt;sudo yum --enablerepo=development install java-1.6.0-openjdk&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;It pulled in new versions of a few things like &lt;tt&gt;zlib&lt;/tt&gt;, but no big deal.  In any case I think you&apos;ll likely see OpenJDK 6 pushed as an update for Fedora 8 too.&lt;/p&gt;&lt;br /&gt;&lt;h3&gt;Why is this so important?&lt;/h3&gt;&lt;br /&gt;&lt;p&gt;It&apos;s pretty hard to underestimate the transformative impact Java and the JVM have had on the software industry in the last decade or so.  Now, Java is a very well designed language, but what I think is equally (if not more) important is the JVM.  The JVM was really pretty far ahead of its time; the &lt;a href=&quot;http://en.wikipedia.org/wiki/HotSpot&quot;&gt;optimizing JIT compiler&lt;/a&gt;, the class structure, the threading model, concurrent generational garbage collection, etc.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;There has been quite a lot of innovation on top of that platform.  Ok, that sounds a bit buzzword-y.  How about this:  People have written &lt;i&gt;a lot of awesome software&lt;/i&gt; for the JVM.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;The examples seem endless; but let&apos;s mention some:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;a href=&quot;http://processing.org/&quot;&gt;Processing&lt;/a&gt; - a combination language and mini-IDE designed for creating visual effects&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href=&quot;http://worldwind.arc.nasa.gov/java/&quot;&gt;NASA&apos;s World Wind&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href=&quot;http://groovy.codehaus.org/&quot;&gt;Groovy&lt;/a&gt;, which is along with &lt;a href=&quot;http://boo.codehaus.org/&quot;&gt;Boo&lt;/a&gt; in my opinion one of the top contenders for the next-generation of programming languages&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href=&quot;http://simile.mit.edu/&quot;&gt;MIT SIMILE&lt;/a&gt; projects like &lt;a href=&quot;http://simile.mit.edu/welkin/&quot;&gt;Welkin&lt;/a&gt;.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href=&quot;http://www.hibernate.org/&quot;&gt;Hibernate&lt;/a&gt; - Best-in-class object-relational mapping&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href=&quot;http://www.eclipse.org/&quot;&gt;Eclipse&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href=&quot;http://hadoop.apache.org/&quot;&gt;Hadoop&lt;/a&gt; - Free Map/Reduce implementation&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;h3&gt;Impact ahead&lt;/h3&gt;&lt;br /&gt;&lt;p&gt;But before OpenJDK, most of these projects effectively did not exist to the core of Free Software community.  Even though all of these projects are themselves Free Software, to run it you had to download and install proprietary JDK.  I think for most of us, we might as well have been required to download a Windows or OS X VM.  At least that&apos;s the way I felt.  It wasn&apos;t very integrated with the operating system.  But most importantly, it was a blob which &lt;i&gt;we didn&apos;t ultimately control&lt;/i&gt;, and we were right to avoid the &lt;a href=&quot;http://www.gnu.org/philosophy/java-trap.html&quot;&gt;Java Trap&lt;/a&gt;.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;But, those were pre-earthquake times.  The integration of the formerly-separate Java/JVM world with the Free Software community is ramping up very quickly.  For example, Fedora is close to landing all of &lt;a href=&quot;https://bugzilla.redhat.com/show_bug.cgi?id=417511&quot;&gt;the dependencies of&lt;/a&gt; &lt;a href=&quot;http://jruby.codehaus.org/&quot;&gt;JRuby&lt;/a&gt;.  I don&apos;t think anyone has started on things like Processing or World Wind yet - &lt;a href=&quot;http://fedoraproject.org/wiki/PackageMaintainers/NewPackageProcess&quot;&gt;it could be you!&lt;/a&gt;&lt;/p&gt;&lt;br /&gt;&lt;h3&gt;A shared Free Software runtime&lt;/h3&gt; &lt;br /&gt;&lt;p&gt;I want to talk specifically about efforts like JRuby, and the &lt;a href=&quot;http://www.theserverside.com/news/thread.tss?thread_id=48627#248615&quot;&gt;newly-invigorated&lt;/a&gt; Jython.  In an &lt;a href=&quot;http://cgwalters.livejournal.com/12380.html&quot;&gt;earlier blog entry&lt;/a&gt;, we looked at the fragmentation in the Free Software community.  Every free language has its own runtime and libraries; and until now, building on the JVM wasn&apos;t an option if you wanted many contributors from the Free Software world.  OpenJDK is finally changing that.  Now, you can write a library using Java, it can be sensibly integrated with Free operating systems like Fedora, and can be consumed by anything on the JVM, which includes Python and Ruby, as well as new languages like Groovy.   We&apos;d actually be sharing more than just the OS kernel and C library.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Crucially, this is a platform we now control, because it&apos;s Free Software.  And the original upstream is not just giving some standards or source code drops, they are &lt;a href=&quot;http://mail.openjdk.java.net/pipermail/discuss/2008-March/001115.html&quot;&gt;actively helping&lt;/a&gt; us.  In fact, &quot;they&quot; are &quot;us&quot; now!&lt;br /&gt;&lt;p&gt;&lt;br /&gt;&lt;a href=&quot;http://cgwalters.livejournal.com/14510.html&quot;&gt;Part 2&lt;/a&gt; of this entry&lt;/p&gt;</description>
  <comments>http://cgwalters.livejournal.com/14310.html</comments>
  <lj:security>public</lj:security>
</item>
<item>
  <guid isPermaLink='true'>http://cgwalters.livejournal.com/14051.html</guid>
  <pubDate>Fri, 14 Mar 2008 22:16:44 GMT</pubDate>
  <title>Making use of those blank new tabs</title>
  <link>http://cgwalters.livejournal.com/14051.html</link>
  <description>&lt;p&gt;I&apos;ve just uploaded a new version of the &lt;a href=&quot;http://firefoxjournal.mozdev.org&quot;&gt;Firefox Journal&lt;/a&gt; to &lt;a href=&quot;https://addons.mozilla.org/en-US/firefox/addon/6744&quot;&gt;Firefox Addons&lt;/a&gt;.  It&apos;s in the &quot;sandbox&quot; right now, which means you need to create an AMO account and enable the sandbox to download it from there.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;In this new release, because the &lt;a href=&quot;http://ed.agadak.net/2007/11/smartbar-to-awesomebar&quot;&gt;awesomebar&lt;/a&gt; does search so well, this version of the journal removes the search interface; it&apos;s now focused on helping you get back to sites you recently visited quickly, as well as providing an automatically-generated list of your 5 most-frequently visited web sites.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Here&apos;s an &lt;a href=&quot;http://firefoxjournal.mozdev.org/screenshots.html&quot;&gt;updated screenshot&lt;/a&gt;.  For more links and background information on the journal, see the &lt;a href=&quot;http://firefoxjournal.mozdev.org/index.html&quot;&gt;home page&lt;/a&gt;.</description>
  <comments>http://cgwalters.livejournal.com/14051.html</comments>
  <lj:security>public</lj:security>
</item>
<item>
  <guid isPermaLink='true'>http://cgwalters.livejournal.com/13671.html</guid>
  <pubDate>Thu, 13 Mar 2008 19:44:33 GMT</pubDate>
  <title>Drawing power from the sky, part 2</title>
  <link>http://cgwalters.livejournal.com/13671.html</link>
  <description>&lt;p&gt;In a &lt;a href=&quot;http://cgwalters.livejournal.com/13298.html&quot;&gt;previous&lt;/a&gt; entry, we briefly looked at Amazon&apos;s Web Services from a high level.  Now that I have my application running reasonably well and debugged, I wanted to write a bit more about my experience.  I&apos;m not claiming true expertise here, but I&apos;ve done my best to learn what I can and hope I can pass on some of this in a comprehensible way.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;So it has certainly been a learning experience trying to understand the overall picture for how one writes an application on top of these APIs.  As background material in this domain, I found the &lt;a href=&quot;http://labs.google.com/papers/gfs.html&quot;&gt;Google FS&lt;/a&gt;, &lt;a href=&quot;http://labs.google.com/papers/bigtable.html&quot;&gt;Bigtable&lt;/a&gt;, and &lt;a href=&quot;http://labs.google.com/papers/mapreduce.html&quot;&gt;Map/Reduce&lt;/a&gt; papers useful, as well as the &lt;a href=&quot;http://www.amazon.com/Building-Scalable-Web-Sites-applications/dp/0596102356/ref=pd_bbs_1?ie=UTF8&amp;amp;s=books&amp;amp;qid=1205430363&amp;amp;sr=8-1&quot;&gt;Building Scalable Websites&lt;/a&gt; O&apos;Reilly book by a Flickr developer.  If you don&apos;t read anything else, read the Map/Reduce paper at least - every programmer should understand it.  Coming from the perspective of an OS/desktop developer, I personally found the GFS and Bigtable papers the most interesting as compared to the POSIX file APIs and SQL, respectively.&lt;/p&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;&quot;Everything you know is wrong.&quot;  - &lt;a href=&quot;http://en.wikipedia.org/wiki/Marble_Madness&quot;&gt;Marble Madness&lt;/a&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;h3&gt;&quot;scalable&quot;&lt;/h3&gt;&lt;br /&gt;&lt;p&gt;One of the most important things I&apos;ve learned is that there are two kinds of &quot;scalable&quot;.  One is the kind of &quot;scalable&quot; that MySQL clustering, JBoss clustering, etc. offer.  These systems take you from one machine to smaller values of N.  They&apos;re typically based on UDP broadcasts or the like.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;The other kind of scale is called &quot;web scale&quot; - this is where your application is a completely distributed system, running in multiple data centers.  No one machine is truly critical.  Your application gets just faster as you add machines.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;What&apos;s the tradeoff between &quot;scalable&quot; and &quot;web scale&quot;?  The answer is pretty simple.  Your application has a number of facets such as reliability, consistency, and availability.  Researchers have essentially come to the conclusion that you can&apos;t have all 3 at the same time as load increases, and of the 3 you almost certainly want to &lt;i&gt;sacrifice (immediate) consistency&lt;/i&gt;.  If I write a new review of a book on Amazon, someone hitting Reload on the same page a few seconds later might not see it.  If I receive an email in GMail, it might fail to be in the search index.  If I delete a picture from Flickr, it might still be in my &quot;photostream&quot; display.  But one property the system &lt;i&gt;can&lt;/i&gt; have is &lt;i&gt;eventual consistency&lt;/i&gt;, on the order of minutes or even seconds perhaps, but not immediate.  My review should eventually appear to the person pressing refresh, the email will appear in the search index, and my picture will truly be gone (from the UI, anyways).&lt;/p&gt;&lt;br /&gt;&lt;h3&gt;On Relational Databases&lt;/h3&gt;&lt;br /&gt;&lt;p&gt;If you look at almost any modern web development framework like &lt;a href=&quot;http://www.jboss.com/products/seam&quot;&gt;JBoss Seam&lt;/a&gt;, &lt;a href=&quot;http://turbogears.org/&quot;&gt;TurboGears&lt;/a&gt;, &lt;a href=&quot;http://www.rubyonrails.org/&quot;&gt;Rails&lt;/a&gt;, etc etc., at the heart is a relational database for storage.  Using a relational database lets you effectively push most of the hard problems like persistent storage and concurrent access onto an external system (though that could be in-process using SQLite).  There are some very smart people who developed SQLite, MySQL, Postgres, etc.  A relational database gives you a &lt;i&gt;lot&lt;/i&gt; for free, and unless you know what you&apos;re doing, you should probably not attempt to store your data directly using say the POSIX file APIs (and this is true on the desktop side too, but that&apos;s another blog entry).&lt;/p&gt;&lt;br /&gt;&lt;p&gt;In other words, for a lot of applications, relational databases are exactly the right solution.  You can get very far with a relational/small cluster system; &lt;a href=&quot;http://meta.wikimedia.org/wiki/Wikimedia_servers&quot;&gt;Wikimedia&lt;/a&gt; is an example here, though their job is obviously made much easier by the fact that reads truly dominate access.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Also worth mentioning is the approach of &lt;a href=&quot;http://en.wikipedia.org/wiki/Partition_(database)&quot;&gt;partitioning&lt;/a&gt; a relational database; though at this point you&apos;re starting to move away from the normalized relational model, since you can no longer perform an operation over your entire data set.&lt;/p&gt;&lt;br /&gt;&lt;h3&gt;So you&apos;ve decided to write a distributed application&lt;/h3&gt;&lt;br /&gt;&lt;p&gt;It should come as no surprise that there&apos;s no magic API to code to in order to create a web-scale system.  What you need to do depends on your application.  You need to have an understanding for how data flows into your system, what kinds of operations you need to perform on it, where and how you can sacrifice consistency, etc.  There&apos;s a lot of more implementation/deployment level things like load balancing and tuning that matter a lot too.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;However, there is a sort of general approach of asynchronous, cached data generation.  In the relational model, every web page view creates a transaction which gets the data it needs, then returns.  This way your users always see up-to-date information.  But in the web scale model, you can massively denormalize by precomputing data.  The advantage is a web page request goes no where near a database; you simply pull the cached data from storage close to the edge web server.   When you get a mutation in your system, you trigger an asynchronous (e.g. map/reduce) process to regenerate all the cached data.  This may not be instant, but with some intelligence in your system you should still be able to have eventual consistency.&lt;/p&gt;&lt;br /&gt;&lt;h3&gt;Writing a bug tracker&lt;/h3&gt;&lt;br /&gt;&lt;p&gt;Let&apos;s say you&apos;re writing a bug tracker.  In a traditional web app, you&apos;d have a form which would do a POST to send an updated comment.  In the handler for that POST you open a transaction, and append a new row to your Comments table.  But in a distributed system, you could generate cached data for each bug.  A GET request for that bug is just a simple transformation of the cached data (perhaps XSLT, or maybe you save the final HTML).  But the POST request to add a comment put is into a reliable work queue (like &lt;a href=&quot;http://www.amazon.com/Simple-Queue-Service-home-page/b?ie=UTF8&amp;amp;node=13584001&quot;&gt;SQS&lt;/a&gt;).  Another machine reads from this queue and triggers a regeneration of the cached bug data - which could be more than just the cached data for that particular bug.  Let&apos;s say you want to be able to display a list of all open bugs.  One way to handle this would be to store in &lt;a href=&quot;http://www.amazon.com/gp/browse.html?node=16427261&quot;&gt;S3&lt;/a&gt; a key &lt;tt&gt;/open/&lt;bugid&gt;&lt;/tt&gt; for each bug.  Then a query of open bugs maps to a listing of all keys with that prefix.   But probably what you really want for these kinds of metadata operations is a system like &lt;a href=&quot;http://www.hypertable.org/&quot;&gt;Hypertable&lt;/a&gt; or &lt;a href=&quot;http://www.amazon.com/b?ie=UTF8&amp;amp;node=342335011&quot;&gt;SimpleDB&lt;/a&gt;.&lt;/p&gt;&lt;br /&gt;&lt;h3&gt;A new kind of operating system?&lt;/h3&gt;&lt;br /&gt;&lt;p&gt;If you look at Amazon&apos;s APIs, they provide the root services you&apos;d expect of an operating system: storage (key/value as opposed to hierarchical), IPC (reliable/persistent), and task creation (Xen image as opposed to process/thread).  The challenge though is rewriting applications to use new APIs.&lt;br /&gt;&lt;h3&gt;Storage&lt;/h3&gt;&lt;br /&gt;&lt;p&gt;I mentioned in the previous entry that I thought storage was the most important of these 3.  There are a lot of messaging systems out there (in particular &lt;a href=&quot;http://amqp.org&quot;&gt;AMQP&lt;/a&gt; looks pretty good), and virtualization APIs abound.  But there are many fewer high-profile storage APIs.  Storage is hard, and rewriting applications for a new form of storage is not at all trivial.  That&apos;s why so much is invested in POSIX-compatible storage systems - if you have that, then you instantly have Apache, rsync, and probably on the order of hundreds of thousands of other useful applications.  But there are limits to the POSIX API; the &lt;a href=&quot;http://labs.google.com/papers/gfs.html&quot;&gt;Google FS&lt;/a&gt; paper discusses those.  Just as there are limits to the relational model.  What is going to be interesting over the next few years is to see which of these new APIs start to win application developers, and how the traditional database-based free software development stacks adapt.&lt;/p&gt;</description>
  <comments>http://cgwalters.livejournal.com/13671.html</comments>
  <lj:security>public</lj:security>
</item>
<item>
  <guid isPermaLink='true'>http://cgwalters.livejournal.com/13494.html</guid>
  <pubDate>Wed, 12 Mar 2008 02:15:15 GMT</pubDate>
  <title>So you have some XML...</title>
  <link>http://cgwalters.livejournal.com/13494.html</link>
  <description>&lt;p&gt;Recently I battled the &lt;a href=&quot;http://code.google.com/p/typica/&quot;&gt;Typica&lt;/a&gt; library for accessing Amazon Web Services.  There was an obscure conflict between its &lt;a href=&quot;https://jaxb.dev.java.net/&quot;&gt;JAXB&lt;/a&gt; dependency and our app server.  JAXB is...well, at its root it compiles XML schemas using a mapping to Java classes.  This is in theory cool - you can get completion in your IDE for web services.  In practice though, it just feels to me like it&apos;s not worth the complexity.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;So, I needed to quickly roll my own Java bindings for AWS.  Basically we need to do a HTTP POST request, and then parse a small returned XML document.  For the first part, &lt;a href=&quot;http://hc.apache.org/httpclient-3.x/&quot;&gt;Apache Commons HTTP&lt;/a&gt; is quite good.  But then I was in a situation in which I&apos;m sure many developers find themselves - you need to get the data out of a small XML document.  No need for schema validation, etc.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;There are a lot of XML libraries out there.  We could use the &lt;a href=&quot;http://www.w3.org/DOM/&quot;&gt;DOM API&lt;/a&gt;, which is familiar because it&apos;s fairly standardized across languages like Python, Java, and JavaScript, despite how nonnative it feels in all of them.  If you&apos;re really a masochist, you&apos;ll try to write a state machine with &lt;a href=&quot;http://en.wikipedia.org/wiki/Simple_API_for_XML&quot;&gt;SAX&lt;/a&gt;.  Then there are the bindings which target a specific library like &lt;a href=&quot;http://www.jdom.org/&quot;&gt;JDOM&lt;/a&gt; for Java, &lt;a href=&quot;http://effbot.org/zone/element-index.htm&quot;&gt;ElementTree&lt;/a&gt; for Python, etc.  These can be nice, but they&apos;re also not portable if you happen to move between different languages (and many developers today probably move between JavaScript and a sane language on the server side).  So, there is another option which gives you a decent API that&apos;s also largely portable: XPath with DOM.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Here&apos;s our sample document:&lt;/p&gt;&lt;br /&gt;&lt;pre&gt;
&amp;lt;ReceiveMessageResponse&amp;gt;
  &amp;lt;ReceiveMessageResult&amp;gt;
    &amp;lt;Message&amp;gt;
      &amp;lt;MessageId&amp;gt;11YEJMCHE2DM483NGN40|3H4AA8J7EJKM0DQZR7E1|PT6DRTB278S4MNY77NJ0&amp;lt;/MessageId&amp;gt;
      &amp;lt;ReceiptHandle&amp;gt;Z2hlcm1hbi5kZXNrdG9wLmFtYXpvbi5jb20=:AAABFoNJa/AAAAAAAAAANwAAAAAAAAAAAAAAAAAAAAQAAAEXAMPLE&amp;lt;/ReceiptHandle&amp;gt;
      &amp;lt;MD5OfBody&amp;gt;acbd18db4cc2f85cedef654fccc4a4d8&amp;lt;/MD5OfBody&amp;gt;
      &amp;lt;Body&amp;gt;foo&amp;lt;/Body&amp;gt;
    &amp;lt;/Message&amp;gt;
    &amp;lt;Message&amp;gt;
      &amp;lt;MessageId&amp;gt;0MKX1FF3JB8VWS8JAV79|3H4AA8J7EJKM0DQZR7E1|PT6DRTB278S4MNY77NJ0&amp;lt;/MessageId&amp;gt;
      &amp;lt;ReceiptHandle&amp;gt;X5djmi3uoi2zZ8Vdr5TkmAQtDTwrcd9lx87=:AAABFoNJa/AAAAAAAAAANwAAAAAAAAAAAAAAAAAAAAQAAAEXAMPLE&amp;lt;/ReceiptHandle&amp;gt;
      &amp;lt;MD5OfBody&amp;gt;37b51d194a7513e45b56f6524f2d51f2&amp;lt;/MD5OfBody&amp;gt;
      &amp;lt;Body&amp;gt;bar&amp;lt;/Body&amp;gt;
    &amp;lt;/Message&amp;gt;
  &amp;lt;/ReceiveMessageResult&amp;gt;
  &amp;lt;ResponseMetadata&amp;gt;
    &amp;lt;RequestId&amp;gt;b5bf2332-e983-4d3e-941a-f64c0d21f00f&amp;lt;/RequestId&amp;gt;
  &amp;lt;/ResponseMetadata&amp;gt;
&amp;lt;/ReceiveMessageResponse&amp;gt;
&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;And here&apos;s the code:&lt;/p&gt;&lt;br /&gt;&lt;pre&gt;
XmlParseData parsed = XmlUtils.parseXml(post.getResponseBodyAsStream(), 
                                        new String[] { &quot;q&quot;, &quot;http://queue.amazonaws.com/doc/2008-01-01/&quot; });			
NodeList msgNodes = (NodeList) parsed.xpath.evaluate(&quot;/q:ReceiveMessageResponse/q:ReceiveMessageResult/q:Message&quot;, 
                                                     parsed.doc, XPathConstants.NODESET);
Message[] msgResult = new Message[msgNodes.getLength()];
for (int i = 0; i &amp;lt; msgNodes.getLength(); i++) {
  Node node = msgNodes.item(i);
  msgResult[i] = new Message(parsed.xpath.evaluate(&quot;q:Body&quot;, node),
	                     parsed.xpath.evaluate(&quot;q:ReceiptHandle&quot;, node));
}
&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;I think this is pretty clear; the straight DOM or SAX alternatives would have been notably more lines of code.  The key part being the XPath expression &lt;tt&gt;/q:ReceiveMessageResponse/q:ReceiveMessageResult/q:Message&lt;/tt&gt; which gives us all the Message nodes.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;For more about parsing XML in Java (though largely applicable to other systems that have XPath bindings), see &lt;a href=&quot;http://www.ibm.com/developerworks/library/x-javaxpathapi.html&quot;&gt;this DeveloperWorks article&lt;/a&gt; may be useful.  Also, &lt;a href=&quot;http://svn.mugshot.org/dumbhippo/trunk/server/src/com/dumbhippo/XmlUtils.java&quot;&gt;this&lt;/a&gt; is the wrapper class I used in the code sample.  And yes, I am using &lt;tt&gt;new String[]&lt;/tt&gt; to work around Java&apos;s lack of hash literals.&lt;/p&gt;</description>
  <comments>http://cgwalters.livejournal.com/13494.html</comments>
  <lj:security>public</lj:security>
</item>
<item>
  <guid isPermaLink='true'>http://cgwalters.livejournal.com/13298.html</guid>
  <pubDate>Thu, 21 Feb 2008 03:26:31 GMT</pubDate>
  <title>Drawing (nearly) unlimited power from the sky  </title>
  <link>http://cgwalters.livejournal.com/13298.html</link>
  <description>&lt;p&gt;There was &lt;a href=&quot;http://dotearth.blogs.nytimes.com/2008/02/13/federal-lab-says-it-can-harvest-fuel-from-air/&quot;&gt;an interesting article&lt;/a&gt; in the New York Times recently about drawing fuel from the air.  Pretty cool.  However, there&apos;s another kind of power from the sky I want to talk about - &lt;a href=&quot;http://www.amazon.com/gp/browse.html?node=3435361&quot;&gt;Amazon&apos;s Web Services&lt;/a&gt;, which give you unlimited computing in the &quot;cloud&quot;, with just a credit card.&lt;/p&gt;&lt;br /&gt;&lt;h3&gt;Scaling the Mugshot polling&lt;/h3&gt;&lt;br /&gt;&lt;p&gt;Recently I&apos;ve been working on improving the way Mugshot does its polling for changes in various things like RSS feeds, Last.fm and Flickr APIs, etc.  Previously, we parsed and stored RSS feeds as individual entries in our relational database.  This worked fine for a while, but as we grew we started spending a lot of time reading the feeds out of the database, just to compare their content to the new version to decide when something changed.  A much simpler way to do this is just to store a hash value (say SHA1), and compare it to the hash of the new version - no database involved.  If the hash has changed, then we do a full parse and check for changes.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;The other thing I wanted to do was easily allow for the feed polling load to be spread out across a number of machines.  We don&apos;t yet have enough feeds where we really need multiple machines, but it seems like something that would be good to be ready to parallelize.  I&apos;m calling the new system Firehose; it&apos;s not really a very complex codebase, mostly I spent a lot of time dealing with AWS binding issues; &lt;a href=&quot;http://code.google.com/p/boto/issues/detail?id=96&quot;&gt;updating&lt;/a&gt; the Python bindings for AWS needed to be updated for the new SQS API, and I had to toss together a lightweight Java binding for SQS too because of an obscure conflict between dependencies of &lt;a href=&quot;http://code.google.com/p/typica/&quot;&gt;typica&lt;/a&gt; and our version of &lt;a href=&quot;http://jboss.org&quot;&gt;JBoss&lt;/a&gt;.  Anyways, that is the boring stuff.&lt;/p&gt;&lt;br /&gt;&lt;h3&gt;Entering the cloud&lt;/h3&gt;&lt;br /&gt;&lt;p&gt;In a very brief summary,  the key Amazon services are:&lt;br /&gt;&lt;ul&gt;Key/value pair persistent storage (S3)&lt;/ul&gt;&lt;br /&gt;&lt;ul&gt;Compute nodes (EC2)&lt;/ul&gt;&lt;br /&gt;&lt;ul&gt;A messaging system (SQS)&lt;/ul&gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;I&apos;m not going to drown you in buzzwords here - but it is very important to understand just how different this system is than a LAMP stack or J2EE app server cluster.  First, all of these services are &lt;i&gt;web scale&lt;/i&gt;; the key architectural point here being that by adding nodes, the service just gets faster and more reliable.  However, these APIs also require a very different way of writing your application.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;For example, the architecture behind Firehose is that there is a master process which simply maintains in-memory a set of pending tasks.  It then dynamically allocates a set of slave servers to process the active tasks, using the EC2 API.  In other words, &lt;i&gt;the application&lt;/i&gt; is automatically provisioning new servers.  It scales itself.  If there is a sudden influx of new feeds to process, no intervention by me is required to allocate new servers or storage.  If we delete tasks (for example, if we start an agreement with a service provider such as Last.fm to have them efficiently push changes to us rather than requiring polling), then the service scales itself down.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;EC2 is pretty neat - it gives a feeling of unlimited raw power at your fingertips.  I know that at any time, on demand, I could spin up any number of servers I want, have them process a lot of data, and then shut them down when I&apos;m finished, all for a price of cents per hour.  If I stop running any servers, it doesn&apos;t cost me any money.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;There are many things that fit into this dynamic batch-processing model.  For example, &lt;a href=&quot;http://developer.amazonwebservices.com/connect/entry.jspa?externalID=691&amp;amp;categoryID=100&quot;&gt;this article&lt;/a&gt; by the creator of the Python bindings for EC2 shows how to batch-convert a large video collection.  A use case topical for Fedora would be infinitely scalable software rebuilds; no more getting held behind kernel and openoffice rebuilds.  As the large North American engineer group comes online in the morning and afternoon, the system could scale itself up, allocating more servers.  At night when load is less, the system deallocates servers, saving money.&lt;/p&gt;&lt;br /&gt;&lt;h3&gt;Coding for the cloud&lt;/h3&gt;&lt;br /&gt;&lt;p&gt;What I find most interesting though is new APIs for writing server applications.  These APIs are not all of the same complexity - EC2 is mostly just a fancy &lt;tt&gt;fork()&lt;/tt&gt; that actually allocates a new OS image.  Of the APIs, S3 is the most interesting.  In a future blog post, I&apos;ll talk about storage, because how you store your data has a profound effect on application architecture.   Developers before now have generally coded to either the POSIX filesystem API, or relational storage.  But S3 is not POSIX and it&apos;s not relational.  Would it make sense for the operating system (Linux) itself to provide a default API for storage that isn&apos;t POSIX or relational?&lt;/p&gt;</description>
  <comments>http://cgwalters.livejournal.com/13298.html</comments>
  <lj:security>public</lj:security>
</item>
<item>
  <guid isPermaLink='true'>http://cgwalters.livejournal.com/12829.html</guid>
  <pubDate>Wed, 13 Feb 2008 00:23:46 GMT</pubDate>
  <title>Internet Everywhere with CDMA and NetworkManager</title>
  <link>http://cgwalters.livejournal.com/12829.html</link>
  <description>&lt;p&gt;I subscribed to Verizon Mobile Broadband recently, after having paid for Wi-Fi one too many times at coffee shops.  Googling for my card model (Kyocera KPC680) before I ordered it seemed to turn up a few hits, but the instructions I&apos;d found were all about setting up PPP manually in config files in &lt;tt&gt;/etc&lt;/tt&gt; and the like.  Seeing as this is 2008 and not 1998, I started checking out &lt;a href=&quot;http://www.gnome.org/projects/NetworkManager/&quot;&gt;NetworkManager&lt;/a&gt;&apos;s support.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;center&gt;&lt;a href=&quot;http://pics.livejournal.com/cgwalters/pic/00011gx3/&quot;&gt;&lt;img src=&quot;http://pics.livejournal.com/cgwalters/pic/00011gx3/s320x240&quot; width=&quot;320&quot; height=&quot;97&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;i&gt;NetworkManager connected to Verizon EV-DO&lt;/i&gt;&lt;/center&gt;&lt;br /&gt;&lt;p&gt;It turned out my card was new enough that the kernel driver PCI lists didn&apos;t include it - but adding it to the driver PCI ID list, and writing a &lt;tt&gt;.fdi&lt;/tt&gt; file so it was flagged as a CDMA modem got me going.  Both of these changes should be showing up in Linux kernel and HAL releases hopefully.  So far it&apos;s been very reliable, and all I have to do is click on the NetworkManager applet and pick &quot;Auto CDMA Dialup connection&quot;.  Pretty cool, nice work NM team!&lt;/p&gt;</description>
  <comments>http://cgwalters.livejournal.com/12829.html</comments>
  <lj:security>public</lj:security>
</item>
<item>
  <guid isPermaLink='true'>http://cgwalters.livejournal.com/12584.html</guid>
  <pubDate>Sat, 09 Feb 2008 18:22:02 GMT</pubDate>
  <title>Free Software and Linux should not be a choose-your-own-adventure game</title>
  <link>http://cgwalters.livejournal.com/12584.html</link>
  <description>&lt;p&gt;Fairly recently, I ran out of disk space.  If you&apos;re a developer, especially one who uses things like &lt;a href=&quot;http://live.gnome.org/Jhbuild&quot;&gt;JHBuild&lt;/a&gt;, virtualization, etc. - this has almost certainly happened to you.  The consequences are pretty unpleasant (search for &lt;tt&gt;disk space&lt;/tt&gt; in the GNOME bugzilla).&lt;/p&gt;&lt;br /&gt;&lt;p&gt;This got me to wondering - why the heck didn&apos;t GNOME have a low disk space notification?  This morning I decided to look into that.  Certainly a patch would be not more than 100 lines to do a libnotify notification, along with an action to say empty your trash.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;It turns out that I (and at least Fedora) had been victim of two things.  1) autoconf 2) GNOME release policy.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;What happened of course is that the code exists - it was just conditional on libnotify-devel being installed.  From the &lt;a href=&quot;http://koji.fedoraproject.org/packages/gnome-volume-manager/2.22.0/2.fc9/data/logs/i386/build.log&quot;&gt;Fedora gnome-volume-manager build log&lt;/a&gt;:&lt;/p&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;checking for NOTIFY... no&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;p&gt;So the the support wasn&apos;t being compiled in, for who knows how long.  I just fixed this for Rawhide, but we need to stop thinking of Linux as a source of random bits that you can put together optionally, and instead think of it as one unified stack.  That means if you&apos;re a software maintainer - your check should not be if (have_libnotify_h), but instead if (linux) { require(libnotify_h) }.  GNOME release policy totally ignores the fact that the vast majority of people using GNOME have these components.  I understand the desire for things to be optional - we want GNOME to work on Maemo and new devices where not all of the stack may exist.  But the right approach is for these new distributions to use flags like &lt;tt&gt;--disable-notify&lt;/tt&gt;.  Or we can use a semi-standardized flag like &lt;tt&gt;--enable-maemo&lt;/tt&gt;, since often these non-desktop devices require other source changes too.&lt;/p&gt;</description>
  <comments>http://cgwalters.livejournal.com/12584.html</comments>
  <lj:security>public</lj:security>
</item>
<item>
  <guid isPermaLink='true'>http://cgwalters.livejournal.com/12380.html</guid>
  <pubDate>Sat, 26 Jan 2008 17:22:11 GMT</pubDate>
  <title>The future of programming language runtimes</title>
  <link>http://cgwalters.livejournal.com/12380.html</link>
  <description>&lt;p&gt;There is a saying in linguistics, &quot;&lt;a href=&quot;http://en.wikipedia.org/wiki/Dialect#.22A_language_is_a_dialect_with_an_army_and_navy.22&quot;&gt;A language is a dialect with an army and a navy&lt;/a&gt;.  I think this applies in a way to computer programming languages too.  The most widespread programming languages aren&apos;t necessarily the ones that are &quot;perfect&quot; in an Esperanto sort of way, but the ones which have an army and a navy - i.e. large corporations backing them.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;Fragmentation&lt;/h3&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;The current fragmentation in the language runtime space is quite disheartening.  It&apos;s still best described by this &lt;a href=&quot;http://people.redhat.com/~hp/proposal/proposal.html&quot;&gt;7-year old hub paper&lt;/a&gt; by Havoc and Owen.  I hope they won&apos;t be mind my linking to it.  Examples of this fragmentation problem are still prevalent today.  The difficulties in using &lt;tt&gt;gtkmozemebed&lt;/tt&gt; from Python due to two garbage collectors and type systems in one process.  To use the Linux &lt;tt&gt;inotify&lt;/tt&gt; system from Ruby, you need a &lt;a href=&quot;http://raa.ruby-lang.org/project/ruby-inotify/&quot;&gt;random third party binding&lt;/a&gt; that may or may not be up to date.  If you want to use the Eclipse rich text editor in your next OCaml program, well you&apos;re just screwed.  The examples are almost endless...most pairs of (API X, runtime Y).  Not all of those are sensible combinations, but a lot of them are.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Now, the problem with Hub I think was that it assumed you could still sensibly mesh unmanaged languages like C/C++ as they are today with managed VM-based runtimes like Python and Java.  If you&apos;ve been following the Mozilla project, you know that they are embarking on a huge effort to &lt;a href=&quot;http://wiki.mozilla.org/XPCOMGC&quot;&gt;automatically rewrite&lt;/a&gt; their 2+ million lines of code to go from C++ with reference counting to C++ with garbage collection, because the problems with leaks between the two systems are too hard.  (By the way, this stuff is really cool and worth &lt;a href=&quot;http://blog.mozilla.com/tglek&quot;&gt;watching&lt;/a&gt; as I&apos;ve mentioned before).&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;In the GNOME community, we largely get by with systems such as &lt;a href=&quot;http://pygtk.org&quot;&gt;PyGTK&lt;/a&gt; and &lt;a href=&quot;http://www.mono-project.com/GtkSharp&quot;&gt;Gtk#&lt;/a&gt; that do mix runtimes with reference-counted C because we&apos;re not running untrusted code from the Internet, like Mozilla has to.  If you forget to destroy that widget you removed but that still had signal handlers calling managed code connected to it, it&apos;s a bug in your application that is your fault - not the fault of some college student writing his first JavaScript application that was an intern at a website you visited.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;The technical future&lt;/h3&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;This prediction has been made plenty of times for years, but I think it&apos;s worth repeating.  The future of language runtimes is pretty clearly going towards VM-based runtimes.  C/C++ are dead ends for pretty much anything except a kernel.  More modern &lt;a href=&quot;http://en.wikipedia.org/wiki/AOT_compiler&quot;&gt;AOT-compiled&lt;/a&gt; languages such as OCaml and Haskell have a lot to gain by switching to a VM.  Concurrent, generational garbage collection isn&apos;t trivial, and a modern VM gives you that.  Being able to load code dynamically, or programmatically construct new optimized functions at runtime for specific data is very appealing.  Debugging is significantly easier.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;The political future&lt;/h3&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;So, here we are in 2008.  Is the situation much better?  In some ways, yes.  The Free Software community now includes &lt;a href=&quot;http://icedtea.classpath.org/wiki/Main_Page&quot;&gt;Java&lt;/a&gt;.  Popularity of truly open, community-driven languages and runtimes such as &lt;a href=&quot;http://python.org&quot;&gt;Python&lt;/a&gt; and &lt;a href=&quot;http://ruby-lang.org&quot;&gt;Ruby&lt;/a&gt; seems to be rising.  And finally, there is a project which is attempting to create a .NET base language runtime, &lt;a href=&quot;http://mono-project.com&quot;&gt;Mono&lt;/a&gt;.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;h4&gt;Mono&lt;/h4&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;The Mono project is the marriage of two major ideas.  A runtime designed for multiple languages is a very unifying concept.  It would solve almost all of the issues Hub was attempting to address for managed, VM-style languages.  It leaves C/C++ out unless they&apos;re manually bound, but there&apos;s no helping that.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;The second idea though of Mono is that it is &lt;b&gt;defined&lt;/b&gt; as a .NET clone.  This idea has proven very divisive.  One company, Microsoft, is the upstream.  This is not a good idea for the Free Software community; we don&apos;t have control of our technical destiny anymore.  If we want to add a bytecode that makes Python run better, we have to wait for decisions to be made in some Microsoft boardroom.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;If I was in charge of Mono, what I would do immediately is reach out to 3 communities that are much more clearly part of the Free Software world: &lt;a href=&quot;http://python.org&quot;&gt;Python&lt;/a&gt;, &lt;a href=&quot;http://ruby-lang.org&quot;&gt;Ruby&lt;/a&gt; and finally - &lt;a href=&quot;http://www.mozilla.org/projects/tamarin/&quot;&gt;Mozilla Tamarin&lt;/a&gt;.  Mono could say to these communities, &quot;Hey, we&apos;ll be your JIT, garbage collector, and common library runtime&quot; - but with the freedom to adapt and change to the needs of these communities.  Especially having Mozilla on board would be a coup, because it&apos;s shipped to so many people.  I certainly wouldn&apos;t have a problem making my application depend on Firefox being installed on Windows.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;The problem with separate projects like &lt;a href=&quot;http://www.jython.org/Project/index.html&quot;&gt;Jython&lt;/a&gt; and &lt;a href=&quot;http://www.codeplex.com/Wiki/View.aspx?ProjectName=IronPython&quot;&gt;IronPython&lt;/a&gt;, &lt;a href=&quot;http://jruby.codehaus.org/&quot;&gt;JRuby&lt;/a&gt; etc., is that they&apos;re essentially forks.  They have connections with the upstream, but that&apos;s not the same as &lt;i&gt;being&lt;/i&gt; the upstream.  If Mono can unify the truly open Free Software languages around one common runtime, it would greatly circle the wagons around&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;Java&lt;/h3&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Sun has finally realized that the idea that every single application would be written in Java and only needs a least-common-denominator API across every platform &lt;a href=&quot;http://openjdk.java.net/projects/mlvm/&quot;&gt;doesn&apos;t work&lt;/a&gt;.  Even more importantly, the JDK is now Free Software, and though the &lt;a href=&quot;http://jcp.org/en/home/index&quot;&gt;JCP&lt;/a&gt; isn&apos;t ideal, it at least exists.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;It certainly seems plausible to me to imagine that Sun would be willing to buy into a shared runtime that wasn&apos;t .NET, but a true cross-corporation, community effort.  They&apos;re already trying to add new bytecodes to better support other languages, but instead we could translate IKVM-style from Java 5.0 bytecodes into a new shared runtime.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;5 years from now...&lt;/h3&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;I really hope I&apos;ll be writing my Python app that&lt;br /&gt;&lt;ul&gt;&lt;br /&gt; &lt;li&gt;Gets efficiently JIT-compiled&lt;/li&gt;&lt;br /&gt; &lt;li&gt;Can access various OS components like inotify automatically as they&apos;re added to a common shared library&lt;/li&gt;&lt;br /&gt; &lt;li&gt;Can seamlessly blend in a Web-like widget that executes other languages such as JavaScript without pain&lt;/li&gt;&lt;br /&gt; &lt;li&gt;Is able to call into frameworks like &lt;a href=&quot;http://www.hibernate.org/&quot;&gt;Hibernate&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Oh, and I want my jetpack.&lt;/p&gt;</description>
  <comments>http://cgwalters.livejournal.com/12380.html</comments>
  <lj:security>public</lj:security>
</item>
<item>
  <guid isPermaLink='true'>http://cgwalters.livejournal.com/12258.html</guid>
  <pubDate>Fri, 25 Jan 2008 02:55:26 GMT</pubDate>
  <title>Hotwire hypershell 0.700 alpha released</title>
  <link>http://cgwalters.livejournal.com/12258.html</link>
  <description>&lt;p&gt;&lt;a href=&quot;http://hotwire-shell.org&quot;&gt;Hotwire 0.700&lt;/a&gt; (&lt;a href=&quot;http://cdn.hotwire-shell.org/index.html&quot;&gt;mirror&lt;/a&gt;) is now available.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;So, about &lt;a href=&quot;http://cgwalters.livejournal.com/1162.html&quot;&gt;8 months ago&lt;/a&gt; you may remember I got really frustrated with &lt;tt&gt;bash&lt;/tt&gt; for carelessly losing my history, and in my spare time, I set out to create a new developer shell.  Not just a plain old Unix shell; I wanted a shell that took advantage of my computer (using a modern language runtime, and integrating with the desktop environment), rather than being limited by the &quot;terminal emulator&quot; concept.  I&apos;d recently tried Windows Powershell around that time as well, and thought they had some good ideas but also made some bad design decisions.  I thought it was possible to do better.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;center&gt;&lt;br /&gt;&lt;a href=&quot;http://hotwire-shell.org&quot;&gt;&lt;img src=&quot;http://lh6.google.com/cgwalters/R5V1lCVMmoI/AAAAAAAABA8/0O7VXZMsDSY/s288/Hotwire-oinspector-filter.png&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;i&gt;Looking for a firefox process&lt;/i&gt;&lt;br /&gt;&lt;/center&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;In short, I wanted to create a &quot;hypershell&quot; that was better than the Unix concept of a shell, and that was also improved on the Windows PowerShell model.  Hotwire 0.700 is the first release where I think that goal is, if not achieved in many ways, much closer at hand.  Previous versions were more like demo toys, but this is the first one I&apos;d call &lt;b&gt;alpha&lt;/b&gt;.  In other words, usable in many ways, although far from complete.  Many developers and power users will hopefully find it a suitable replacement for a terminal+Unix shell running as the same uid on a desktop.  For system administrators, Hotwire doesn&apos;t yet have a really strong story for improving the remoting experience (well, you will probably like the included ssh client), but I&apos;m going to be taking a close look at things like &lt;a href=&quot;https://hosted.fedoraproject.org/func/wiki&quot;&gt;func&lt;/a&gt;.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;The &lt;a href=&quot;http://hotwire-shell.org&quot;&gt;new webpage&lt;/a&gt; (&lt;a href=&quot;http://cdn.hotwire-shell.org/index.html&quot;&gt;mirror&lt;/a&gt;) has a longer explanation of things, screenshots, etc.  The &lt;a href=&quot;http://code.google.com/p/hotwire-shell/wiki/HotwireChanges#Changes_in_Hotwire_0.700_(Current_Release)&quot;&gt;ChangeLog&lt;/a&gt; is also a useful read, especially if you&apos;re upgrading from a previous version.  And don&apos;t forget to try the &lt;a href=&quot;http://code.google.com/p/hotwire-shell/wiki/GettingStarted0700&quot;&gt;updated tutorial&lt;/a&gt; to get a hands-on introduction to the system.</description>
  <comments>http://cgwalters.livejournal.com/12258.html</comments>
  <lj:security>public</lj:security>
</item>
<item>
  <guid isPermaLink='true'>http://cgwalters.livejournal.com/11869.html</guid>
  <pubDate>Fri, 21 Dec 2007 23:18:15 GMT</pubDate>
  <title>NYT on SimpleDB</title>
  <link>http://cgwalters.livejournal.com/11869.html</link>
  <description>The &lt;a href=&quot;http://open.blogs.nytimes.com/2007/12/21/a-first-look-at-amazon-simpledb/&quot;&gt;New York Times Open&lt;/a&gt; blog takes a look at Amazon&apos;s &lt;a href=&quot;http://www.amazon.com/b?ie=UTF8&amp;amp;node=342335011&quot;&gt;SimpleDB&lt;/a&gt;.  I have to agree with him, web-scale computing architecture is a fascinating topic.  I&apos;ve been meaning to set aside time to look at SimpleDB; it feels like the big gap in web-scale is standard/open APIs for structured data storage.  EC2 gives you compute (and the API is fairly obvious), and S3 is your big key-value bucket, but until Amazon announced SimpleDB there were really only hacks for clustering MySQL.  And that only gets you so far.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Another interesting project in this area is &lt;a href=&quot;http://couchdb.org/CouchDB/CouchDBWeb.nsf/Home?OpenForm&quot;&gt;CouchDB&lt;/a&gt;.</description>
  <comments>http://cgwalters.livejournal.com/11869.html</comments>
  <lj:security>public</lj:security>
</item>
</channel>
</rss>
