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

<channel>
	<title>Toolness &#187; Mozilla</title>
	<atom:link href="http://www.toolness.com/wp/?cat=5&#038;feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://www.toolness.com/wp</link>
	<description>The Blog of Atul Varma</description>
	<pubDate>Sun, 17 Jan 2010 19:40:01 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.5</generator>
	<language>en</language>
			<item>
		<title>The Value of Nothing</title>
		<link>http://www.toolness.com/wp/?p=756</link>
		<comments>http://www.toolness.com/wp/?p=756#comments</comments>
		<pubDate>Sun, 17 Jan 2010 19:38:57 +0000</pubDate>
		<dc:creator>Atul</dc:creator>
		
		<category><![CDATA[Mozilla]]></category>

		<guid isPermaLink="false">http://www.toolness.com/wp/?p=756</guid>
		<description><![CDATA[From what I’ve read of Tim Harford’s The Undercover Economist and The Economist, capitalism seems like a reasonable way to make the world a better place, given its assumptions of human nature. In particular, America’s brand of capitalism, which tries to lower the barriers to getting a job or starting a business as much as [...]]]></description>
			<content:encoded><![CDATA[<p>From what I’ve read of Tim Harford’s <a href="http://www.toolness.com/wp/?p=629">The Undercover Economist</a> and <em>The Economist</em>, capitalism seems like a reasonable way to make the world a better place, given its assumptions of human nature. In particular, America’s brand of capitalism, which tries to lower the barriers to getting a job or starting a business as much as possible, seems compatible with notions of liberty and democracy.</p>
<p>I just finished reading <a href="http://www.amazon.com/Value-Nothing-Reshape-Redefine-Democracy/dp/031242924X/ref=sr_1_1?ie=UTF8&amp;s=books&amp;qid=1263677165&amp;sr=8-1">The Value of Nothing</a>, which provides a fascinating counterpoint to all of this. Its author, Raj Patel, doesn’t hate markets—he just wants to pluck from them “the overriding hunger for expansion and profit that has brought us to the brink of ecological catastrophe”.  He also believes that what needs to be plucked from <em>us</em> is “the belief that markets are the only way to value our world”.</p>
<p>This last quote is something that resonates with me.  Some of today’s most prolific companies rely on what I find to be odd business models: they make the money they need to survive as a fortuitous “side effect” that is relatively independent of their utility to the vast majority of their constituents. Firefox, for instance, relies on a sharing economy—open-source, community-driven development—to build a product that is mostly financed through something that few people are even aware of: the ads that a tiny percentage of users click on after performing Google searches at the upper-right hand corner of their browser.</p>
<p>These sorts of tactics strike me as clever “hacks” to capitalism.  Obviously creating a browser like Firefox and making the Web a better place is something a lot of people value—yet this value isn’t really captured by the market.</p>
<p><em>The Value of Nothing</em> is an exploration of alternative ways of valuing ourselves and our world, from Free Software to Food Sovereignty.  Coincidentally or not, many characteristics of these alternatives—they are all transparent, participatory, and de-centralized—happen to share a lot in common with <a href="http://commonspace.wordpress.com/2009/05/28/what-makes-the-web-better/">what makes the Web better</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.toolness.com/wp/?feed=rss2&amp;p=756</wfw:commentRss>
		</item>
		<item>
		<title>Evolving Firefox Extensions</title>
		<link>http://www.toolness.com/wp/?p=746</link>
		<comments>http://www.toolness.com/wp/?p=746#comments</comments>
		<pubDate>Tue, 12 Jan 2010 01:23:36 +0000</pubDate>
		<dc:creator>Atul</dc:creator>
		
		<category><![CDATA[Coding]]></category>

		<category><![CDATA[Mozilla]]></category>

		<guid isPermaLink="false">http://www.toolness.com/wp/?p=746</guid>
		<description><![CDATA[Firefox&#8217;s extension platform is incredibly powerful and generative, but when I created my first extension in early 2008, I found a number of barriers to entry&#8212;difficulties echoed by a number of other newcomers I talked to.
For one thing, extensions were difficult to get started with. Perhaps the best indicator of this is Myk Melez&#8217;s video [...]]]></description>
			<content:encoded><![CDATA[<p>Firefox&#8217;s extension platform is incredibly powerful and generative, but when I created my first extension in early 2008, I found a number of barriers to entry&mdash;difficulties echoed by a number of other newcomers I talked to.</p>
<p>For one thing, extensions were difficult to get started with. Perhaps the best indicator of this is Myk Melez&#8217;s video tutorial titled <a href="http://blog.mozilla.com/addons/2009/03/18/video-tutorial-extensions-bootcamp-zero-to-hello-world-in-45-minutes/">Extensions Bootcamp: Zero to “Hello World” in 45 Minutes</a>, which actually ended up being 90 minutes long.</p>
<p>In May of 2009, we tried to resolve a number of issues for newcomers with our original Jetpack Prototype.  The complex (but powerful) Gecko API was hidden behind a much simpler facade; no tedious setup was required to get up and running, and the effect of changing any part of your code was nearly instantaneous, obviating the need for restarts when developing or even installing a new Jetpack.  Familiar, well-documented technologies like HTML and CSS were used to build interfaces.</p>
<p>Yet there were a lot of things lacking in this prototype. For one, Jetpacks created by developers required the Jetpack extension to be installed in order to use them. There was no mechanism for code sharing and reuse&mdash;not even any kind of packaging system, which made building on another person&#8217;s work or creating more complex Jetpacks very cumbersome. It also had no security model, which meant that Jetpack developers were effectively playing with a loaded gun: a single mistake in a Jetpack&#8217;s code could actually blow a security hole in Firefox that might expose the user&#8217;s computer to all kinds of threats from the web.</p>
<p>We wanted to fix all of these problems, but the one that presented the most challenge to us was that of solving what Jonathan Zittrain calls <a href="http://yupnet.org/zittrain/archives/11#65">The Generative Dilemma</a>: is it possible to make Firefox Extensions <i>safer</i> without compromising generativity?  The sheer inventiveness of the Add-on Community&mdash;NoScript, Adblock Plus, Greasemonkey, and the tens of thousands of other add-ons out there&mdash;never would&#8217;ve been possible if Firefox&#8217;s extension platform wasn&#8217;t as powerful as it is.  Enforcing some kind of &#8220;top-down&#8221; security model on Jetpack that told developers what they could and couldn&#8217;t do simply didn&#8217;t feel right.</p>
<p>Instead, it felt like a better solution would be to create the <i>conditions</i> for a secure platform and allow <i>anyone</i> to create capabilities that securely expose privileged functionality to it.  Such capabilities, or <i>superpowers</i> as we sometimes call them, can expose any part of the Mozilla platform&mdash;which means that it&#8217;s theoretically possible for a Jetpack to do anything that a normal extension can do, while still obeying the <a href="http://en.wikipedia.org/wiki/Principle_of_least_privilege">Principle of Least Authority</a>.</p>
<p>There&#8217;s a number of other features present in the latest in-progress iteration of Jetpack, which we&#8217;re calling the &#8220;reboot&#8221; because rebuilding it from the ground-up with the new goals in mind was much easier than continuing to hack on prototype code.  We&#8217;re now using the <a href="http://commonjs.org/">CommonJS standard</a> to make it easier to reuse code between Jetpack and other JavaScript-based platforms like the Web and <a href="http://narwhaljs.org/">narwhal</a>, for example; Jetpacks are also now fully self-contained XPIs that require nothing but a Mozilla-powered application to run.</p>
<p>There&#8217;s a lot more to the reboot, but it&#8217;s all a little overwhelming to write up in one blog post.  This is an indicator that I should&#8217;ve started blogging about this a lot earlier than today, and I apologize for that.</p>
<p>While the reboot is still in-progress and won&#8217;t be ready for &#8220;prime time&#8221; for quite a while, you&#8217;re welcome to check out the in-progress <a href="https://wiki.mozilla.org/Labs/Jetpack/Reboot_Quickstart">Reboot Quickstart</a> and the various JEPs it links to.  Please feel free to leave comments on this blog or post them directly to the <a href="http://groups.google.com/group/mozilla-labs-jetpack/">Jetpack Google Group</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.toolness.com/wp/?feed=rss2&amp;p=746</wfw:commentRss>
		</item>
		<item>
		<title>Mozilla: The Big Picture</title>
		<link>http://www.toolness.com/wp/?p=731</link>
		<comments>http://www.toolness.com/wp/?p=731#comments</comments>
		<pubDate>Mon, 14 Dec 2009 04:58:45 +0000</pubDate>
		<dc:creator>Atul</dc:creator>
		
		<category><![CDATA[Mozilla]]></category>

		<guid isPermaLink="false">http://www.toolness.com/wp/?p=731</guid>
		<description><![CDATA[I realized over the past year that the Mozilla community doesn&#8217;t just generate cool software&#8212;it actually produces a wealth of great visual assets, too.
I thought it&#8217;d be useful for both folks on the periphery and on the inside to use images as a way of understanding what&#8217;s going on at Mozilla&#8212;sort of like about:mozilla, but [...]]]></description>
			<content:encoded><![CDATA[<p>I realized over the past year that the Mozilla community doesn&#8217;t just generate cool software&mdash;it actually produces a wealth of great visual assets, too.</p>
<p>I thought it&#8217;d be useful for both folks on the periphery and on the inside to use images as a way of understanding what&#8217;s going on at Mozilla&mdash;sort of like <a href="http://www.toolness.com/wp/?p=532">about:mozilla</a>, but using pictures instead of words.</p>
<p>Here&#8217;s what I&#8217;ve got so far:</p>
<p><center><a href="http://hg.toolness.com/mozilla-the-big-picture/raw-file/rough-draft/mbp.html"><img src="http://www.toolness.com/images/20091213201303.jpg" width="400"/></a></center></p>
<p>This <a href="http://hg.toolness.com/mozilla-the-big-picture/raw-file/rough-draft/mbp.html">prototype</a> is a showcase of what happened in the Mozilla community during the month of November 2009.  It includes community-created artwork, photography, screenshots, logos, and UX sketches and mock-ups.  Mousing over each thumbnail displays a high-resolution version of the image on the lower half of the screen, dynamically fetched to take advantage of the viewer&#8217;s screen resolution without wasting network bandwidth.</p>
<p>The mini-gallery is stored using an ad-hoc sort of HTML microformat.  Feel free to take a look at the <a href="http://hg.toolness.com/mozilla-the-big-picture/raw-file/rough-draft/mbp.js">source code</a> and reuse or remix it for your own purposes.</p>
<p>(A word of warning: I&#8217;ve only tried out this prototype on Firefox 3.5 and Safari 4.)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.toolness.com/wp/?feed=rss2&amp;p=731</wfw:commentRss>
		</item>
		<item>
		<title>Web Application Memory Profiling, Take Two</title>
		<link>http://www.toolness.com/wp/?p=709</link>
		<comments>http://www.toolness.com/wp/?p=709#comments</comments>
		<pubDate>Tue, 06 Oct 2009 23:15:30 +0000</pubDate>
		<dc:creator>Atul</dc:creator>
		
		<category><![CDATA[Coding]]></category>

		<category><![CDATA[Mozilla]]></category>

		<guid isPermaLink="false">http://www.toolness.com/wp/?p=709</guid>
		<description><![CDATA[Back in July, the Mozilla Developer Tools Lab released an experimental memory tool that allowed a web developer to get a better picture of Firefox&#8217;s memory usage.  That tool was a great start, but it had a few issues:

It was slow.
It showed the entire Firefox JS heap, which included lots of objects internal to [...]]]></description>
			<content:encoded><![CDATA[<p>Back in July, the Mozilla Developer Tools Lab released an <a href="http://labs.mozilla.com/blog/2009/07/browser-memory-tools-directory/">experimental memory tool</a> that allowed a web developer to get a better picture of Firefox&#8217;s memory usage.  That tool was a great start, but it had a few issues:</p>
<ol>
<li>It was slow.</li>
<li>It showed the entire Firefox JS heap, which included lots of objects internal to Firefox that weren&#8217;t of much use to web developers.</li>
<li>It was a bit of a hassle to set up, as it involved freezing Firefox and accessing a local web server from a different browser.</li>
</ol>
<p>I&#8217;ve spent some time trying to resolve these issues, and have a usable prototype for Firefox 3.5 that <a href="https://addons.mozilla.org/en-US/firefox/addon/14666/">you can try out</a>.  The new tool has an entirely different front-end from the last one and runs in Firefox itself&mdash;no need to launch a separate browser.  It also runs a lot faster, and allows you to profile the JavaScript memory use of individual browser tabs.</p>
<p>Here&#8217;s a screenshot. You can also click on it to read some annotations I&#8217;ve added through Flickr:</p>
<p><center><a href="http://www.flickr.com/photos/86753659@N00/3988687880/"><img src="http://farm4.static.flickr.com/3425/3988687880_7073e5b7e8_o.png" width="400"/></a></center></p>
<p>The above profile was taken while <a href="http://hg.mozilla.org/users/avarma_mozilla.com/memory-profiler/raw-file/blog-post-1/sample-pages/blah.html">this page</a> was open in a tab.  Feel free to look at the page&#8217;s source code and compare it with the profiling output.</p>
<p>One of the first things you&#8217;ll notice is that there&#8217;s no information about actual <i>bytes used</i>.  This is partly because we need to add more instrumentation to Firefox in order to get you really accurate information about that&mdash;something that&#8217;s currently being done with the advent of <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=515354">about:memory</a>.  But it&#8217;s also because raw byte counts aren&#8217;t necessarily helpful in debugging memory leaks in web applications: what&#8217;s really useful is information about what <i>kinds</i> of objects are staying in the page, which this new iteration of the memory tool tries to provide.</p>
<p>If you&#8217;re interested in learning how the tool works or hacking on the code, check out the <a href="https://wiki.mozilla.org/Labs/Memory_Profiler">wiki page</a> and my <a href="http://www.toolness.com/wp/?p=604">Fun with SpiderMonkey</a> blog post.</p>
<p>What I&#8217;m really interested in knowing is: do web developers find this useful?  What could be added to it to make it more useful in diagnosing the memory use of a web application? If you&#8217;re a web developer, please <a href="https://addons.mozilla.org/en-US/firefox/addon/14666/">download the addon</a>, choose &#8220;Memory Profiler&#8221; from the &#8220;Tools&#8221; menu in Firefox, and let us know what you think!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.toolness.com/wp/?feed=rss2&amp;p=709</wfw:commentRss>
		</item>
		<item>
		<title>Liberating Your Data From Other People</title>
		<link>http://www.toolness.com/wp/?p=703</link>
		<comments>http://www.toolness.com/wp/?p=703#comments</comments>
		<pubDate>Tue, 15 Sep 2009 11:14:45 +0000</pubDate>
		<dc:creator>Atul</dc:creator>
		
		<category><![CDATA[Mozilla]]></category>

		<guid isPermaLink="false">http://www.toolness.com/wp/?p=703</guid>
		<description><![CDATA[Ragavan recently posted some interesting thoughts on DataLiberation that got me thinking:
Another factor to consider is how you define what “your data” is. For example, if you look at it as just exporting your photos out of Picasa and importing them to flickr, I’d posit that’s a rather simplistic view. A large part of what [...]]]></description>
			<content:encoded><![CDATA[<p>Ragavan recently posted some <a href="http://ragavan.wordpress.com/2009/09/14/quick-thoughts-on-dataliberation/">interesting thoughts</a> on <a href="http://www.dataliberation.org/">DataLiberation</a> that got me thinking:</p>
<blockquote><p>Another factor to consider is how you define what “your data” is. For example, if you look at it as just exporting your photos out of Picasa and importing them to flickr, I’d posit that’s a rather simplistic view. A large part of what makes your data useful and valuable is all the relationships associated with it. I share my photos with my friends and family, I license some under Creative Commons, I group them, I tag them – all of these make my data very context rich. How do you liberate this context? And if you do, what does it mean to import them elsewhere?</p></blockquote>
<p>On a public forum I used to frequent, one user used to immediately delete all his posts whenever he lost an argument.  In the context of Data Liberation, this could be considered a good thing: his posts were <i>his</i> data, not the property of the company (or rather, the volunteer community member) hosting the data. But on the other hand, his behavior also made entire conversations completely inscrutable to everyone else in the community.  What used to be an interesting public dialogue between two people suddenly became one person talking at a wall.</p>
<p>It&#8217;s very easy to assume that the things we create are ours, and not some corporation&#8217;s: but what happens when you give what you created to someone, or to a community, or to the public?  Does the ownership of that information become theirs to any extent?</p>
<p>If you take a photograph and give it to your grandma, what kind of rights should you have to take it back?  Should grandma have the freedom to copy the photo you gave her&mdash;by posting it to your photo stream on Flickr&mdash;to her computer&#8217;s hard drive before you delete it from Flickr?  Or should <i>you</i> have the freedom to be able to magically zap <i>your</i> data from her hard drive?</p>
<p>Who actually owns the data?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.toolness.com/wp/?feed=rss2&amp;p=703</wfw:commentRss>
		</item>
		<item>
		<title>Coming At You Like A Pydermonkey</title>
		<link>http://www.toolness.com/wp/?p=678</link>
		<comments>http://www.toolness.com/wp/?p=678#comments</comments>
		<pubDate>Fri, 11 Sep 2009 22:48:09 +0000</pubDate>
		<dc:creator>Atul</dc:creator>
		
		<category><![CDATA[Coding]]></category>

		<category><![CDATA[Mozilla]]></category>

		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://www.toolness.com/wp/?p=678</guid>
		<description><![CDATA[Since learning JavaScript over a year ago, it&#8217;s become one of my favorite dynamic programming languages alongside Python.  And as I&#8217;ve mentioned before, I think the two languages actually complement each other pretty well.
Python, at its heart, is a platform that&#8217;s built to be extended.  The evidence for this is plentiful: there&#8217;s modules [...]]]></description>
			<content:encoded><![CDATA[<p>Since learning JavaScript over a year ago, it&#8217;s become one of my favorite dynamic programming languages alongside Python.  And as I&#8217;ve <a href="http://www.toolness.com/wp/?p=48">mentioned before</a>, I think the two languages actually complement each other pretty well.</p>
<p>Python, at its heart, is a platform that&#8217;s built to be <a href="http://twistedmatrix.com/users/glyph/rant/extendit.html">extended</a>.  The evidence for this is plentiful: there&#8217;s modules and packages out there that offer practically any functionality you want, from web servers to 3D game engines to natural language processing toolkits and more, all instantly accessible through a simple command or an installer download. Yet one of the costs of all this generativity has been the fact that Python doesn&#8217;t really have much of a security model to speak of: any Python program has as much access to the underlying system as the current user does, which, compared to the Web, is basically omnipotence.  Creating programs that obey the <a href="http://en.wikipedia.org/wiki/Principle_of_least_privilege">principle of least privilege</a> is pretty hard.</p>
<p>JavaScript, on the other hand, has many of the opposite problems.  For one thing, it&#8217;s really built for embedding: until the very recent advent of <a href="http://wiki.commonjs.org/wiki/CommonJS">CommonJS</a> and <a href="http://narwhaljs.org/">Narwhal</a>, for instance, the language has always lacked a general-purpose platform and standard library.  A Pythonic way of saying this is that the language doesn&#8217;t come with &#8220;batteries included&#8221;, but this can actually be a good thing from a security standpoint: because the simplest possible embedding has no privileges and needs to be explicitly given all its capabilities by its embedder, it&#8217;s very easy to follow the principle of least privilege.  Recent work on <a href="http://www.toolness.com/wp/?p=642">membranes</a> and <a href="http://en.wikipedia.org/wiki/Caja_%28programming_language%29">capability models</a> puts JavaScript way ahead of many other languages in the security realm, yet the lack of a mature general-purpose platform has meant that anyone who&#8217;s wanted to leverage these strengths has always had to muck around in C/C++ to create the kind of embedding they wanted.</p>
<p>Well, to an extent.  One of the many aspects of Java that I&#8217;ve frequently been envious of has been <a href="http://en.wikipedia.org/wiki/Rhino_%28JavaScript_engine%29">Rhino</a>, a JavaScript engine written entirely in Java, which allows anyone who knows Java to create their own embedding solution that leverages Java&#8217;s strengths.  But I prefer Python to Java, and moreover, the engine itself isn&#8217;t worked on with as much intensity as the JS engines that power real-world consumer products like V8 and SpiderMonkey&mdash;so new language features are slow to be implemented and performance isn&#8217;t great.</p>
<p>I&#8217;d briefly tried resurrecting John J. Lee&#8217;s <a href="http://code.google.com/p/python-spidermonkey/">Python-Spidermonkey</a> last year but I soon discovered that it wasn&#8217;t really what I wanted.  For instance, JS objects were copied into Python approximations as they crossed the language boundary, which resulted in a &#8220;lossy&#8221; transfer and prevented features like identity perseverance.  It was essentially a high-level wrapper created to solve a specific problem, rather than a low-level tool intended to enable any kind of wrapping based on context (e.g., how trusted the JS code is).</p>
<h4>Introductions</h4>
<p>In part because of all this, and in part because I&#8217;d always wanted to write a Python C extension from scratch, I&#8217;ve decided to create a new Python-Spidermonkey bridge: <a href="http://code.google.com/p/pydermonkey/">Pydermonkey</a>.</p>
<p>Pydermonkey&#8217;s mission is pretty simple and straightforward: it&#8217;s just meant to wrap <a href="https://developer.mozilla.org/En/SpiderMonkey/JSAPI_User_Guide">Spidermonkey&#8217;s C API</a> as faithfully as possible&mdash;including its debugging API&mdash;while enforcing the memory safety that Python is known for.  This makes it awfully low-level for casual programmers, but thanks to Python&#8217;s awesome support for <a href="http://docs.python.org/reference/datamodel.html#special-method-names">magic methods</a>, it&#8217;s not hard to create high-level wrappers that provide much more convenient bridging between JavaScript and Python code.</p>
<h4>Where It&#8217;s At</h4>
<p>Pydermonkey is currently at version 0.0.6; its <a href="http://pydermonkey.googlecode.com/hg/docs/rendered/pydermonkey.html">API</a> supports a decent subset of the Spidermonkey C API, but it&#8217;s still quite lacking in places: operation callbacks will allow you to run untrusted code that runs in infinite loops, throw hooks allow for full Python-esque stack tracebacks of JS code, yet property catchalls haven&#8217;t yet been implemented, which means that security is constrained to conventional sandboxing (membranes and object capabilities aren&#8217;t currently possible).  There&#8217;s also the nasty problem of not being able to detect reference cycles that cross language boundaries, which means that such cycles need to be broken manually for now.</p>
<h4>Getting It</h4>
<p>Pydermonkey is available at the <a href="http://pypi.python.org/pypi/pydermonkey">Python Package Index</a> in source form, and as a precompiled binary for the few platforms that I happen to have access to at the moment.</p>
<p>You should be able to type <tt>easy_install pydermonkey</tt> at the command line and everything should &#8220;just work&#8221;: I&#8217;ve set up the <a href="http://www.blueskyonmars.com/projects/paver/">Paver</a> build script such that the Spidermonkey source code is automatically downloaded and built before the C extension if you&#8217;ve got the compiler toolchain on your system, though there are a few snags on Windows to circumnavigate. For more information, <a href="http://pydermonkey.googlecode.com/hg/docs/rendered/index.html">read the Pydermonkey documentation</a>.  And please feel free to <a href="http://code.google.com/p/pydermonkey/issues/list">file a bug</a> if you run into one!</p>
<h4>Where To Go From Here</h4>
<p>If you&#8217;d like to see an example of a high-level wrapper, check out my <a href="http://hg.toolness.com/pydertron/raw-file/tip/docs.html">Pydertron</a> experiment.  It provides a simple interface to expose untrusted JS functionality to Python code and also contains a CommonJS-compliant implementation of the <a href="http://wiki.commonjs.org/wiki/CommonJS/Modules/SecurableModules">SecurableModule</a> standard.  I&#8217;m also playing around with creating a Pydermonkey engine for Narwhal on <a href="http://github.com/toolness/narwhal">github</a>; contributions to any of these codebases are more than welcome, and there&#8217;s some low-hanging fruit in Pydermonkey that would be perfect for students or first-time contributors.</p>
<p>Finally, if you do anything interesting with Pydermonkey, I&#8217;d love to know about it.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.toolness.com/wp/?feed=rss2&amp;p=678</wfw:commentRss>
		</item>
		<item>
		<title>Kids And The Open Web</title>
		<link>http://www.toolness.com/wp/?p=665</link>
		<comments>http://www.toolness.com/wp/?p=665#comments</comments>
		<pubDate>Fri, 04 Sep 2009 13:47:07 +0000</pubDate>
		<dc:creator>Atul</dc:creator>
		
		<category><![CDATA[Coding]]></category>

		<category><![CDATA[Mozilla]]></category>

		<category><![CDATA[Usability]]></category>

		<guid isPermaLink="false">http://www.toolness.com/wp/?p=665</guid>
		<description><![CDATA[Every time I think about why I like the open web, I basically think of how well it fits with the way I learned to use and program computers as a kid: my first computer, an Atari 400, came with everything I needed to do programming, and I (or my parents) didn&#8217;t have to spend [...]]]></description>
			<content:encoded><![CDATA[<p>Every time I think about why I like the open web, I basically think of how well it fits with the way I learned to use and program computers as a kid: my first computer, an <a href="http://en.wikipedia.org/wiki/Atari_8-bit_family">Atari 400</a>, came with everything I needed to do programming, and I (or my parents) didn&#8217;t have to spend hundreds of dollars or sign an NDA to get a development tool.</p>
<p>My favorite technical book as a child was <a href="http://www.atariarchives.org/adventure/">Creating Adventure Games On Your Computer</a>, which contained plain BASIC code for games that you could play, augment, and make your own.  A column in one of my favorite magazines, <a href="http://en.wikipedia.org/wiki/3-2-1_Contact">3-2-1 Contact</a>, featured the same kind of content.</p>
<p>All of this was easy enough for a child to grasp&mdash;often far easier, as Jef Raskin observed in <a href="http://en.wikipedia.org/wiki/The_Humane_Interface">The Humane Interface</a>, than today&#8217;s development tools. But being able to use a tool that provided an incredibly low barrier to generativity is something that I value a lot about my childhood.  It&#8217;s in part where a lot of the real passion and excitement for open source and the Open Web come from: people like me see in them the qualities that made them truly excited about computers as a kid.  Qualities that we&#8217;re constantly in danger of losing today as the field becomes more professionalized and controlled.</p>
<p>So that got me <a href="http://www.toolness.com/wp/?p=659">thinking about Drumbeat</a> again: what if promotional materials for the Open Web focused on how it makes lives better for <i>children</i> who are budding hackers?  Lots of adults aren&#8217;t tech savvy, but they know that their kids are, and if we can prove that the Open Web is better for their kids, and that they can make their kids&#8217; lives better by choosing a standards-compliant browser, maybe they will.</p>
<p>After playing around with this idea for a bit, I came up with this:</p>
<p><center><a href="http://hg.toolness.com/scratch/raw-file/ink_blog_post/open_web_magic_ink/open_web_magic_ink.html"><img width="200" src="http://www.toolness.com/images/20090904061359.jpg"/></a></center></p>
<p>The photo on the page is taken from Flickr user .sick sad little world.&#8217;s <a href="http://www.flickr.com/photos/something2burn/2248756833">The Taste of Ink</a>.  Feel free to <a href="http://hg.toolness.com/scratch/rev/ink_blog_post">get the source</a> and remix!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.toolness.com/wp/?feed=rss2&amp;p=665</wfw:commentRss>
		</item>
		<item>
		<title>Freedom At The Endpoints</title>
		<link>http://www.toolness.com/wp/?p=659</link>
		<comments>http://www.toolness.com/wp/?p=659#comments</comments>
		<pubDate>Wed, 02 Sep 2009 19:35:23 +0000</pubDate>
		<dc:creator>Atul</dc:creator>
		
		<category><![CDATA[Mozilla]]></category>

		<guid isPermaLink="false">http://www.toolness.com/wp/?p=659</guid>
		<description><![CDATA[Lately I&#8217;ve been thinking a bit about Drumbeat, and what the Open Web actually means to me.  This morning, I came across an article by Katherine Mangu-Ward titled Transparency Chic which reminded me about a few of its most important aspects.
Transparency Chic discusses a Firefox addon called RECAP which helps make U.S. Judicial Records [...]]]></description>
			<content:encoded><![CDATA[<p>Lately I&#8217;ve been thinking a bit about <a href="https://wiki.mozilla.org/Drumbeat">Drumbeat</a>, and what the Open Web actually means to me.  This morning, I came across an article by Katherine Mangu-Ward titled <a href="http://reason.com/news/show/135612.html">Transparency Chic</a> which reminded me about a few of its most important aspects.</p>
<p><i>Transparency Chic</i> discusses a Firefox addon called <a href="https://www.recapthelaw.org/">RECAP</a> which helps make U.S. Judicial Records as freely-searchable as everything in Google by taking any of the free information browsed through PACER, the Federal court system&#8217;s clunky web-based database that charges eight cents per page, and submits it automatically to a free Internet archive.</p>
<p>One of the foundational principles of the Internet RECAP reminds me of is Jonathan Zittrain&#8217;s notion, explained in <a href="http://www.toolness.com/wp/?p=53">The Future of the Internet</a>, that <b>the endpoint matters</b>.  Cell phones, console gaming systems, and PCs are some of the destinations of the information and functionality that the Internet is built to transmit.  Yet only the PC unilaterally provides its user with an extraordinary amount of control to alter any aspect of its behavior through third-party software.  If it weren&#8217;t for this fact, and if it weren&#8217;t for the generativity enabled by Firefox exposing its internals to addon developers&mdash;that &#8220;freedom at the endpoint&#8221;&mdash;a subversive-yet-legal tool like RECAP simply couldn&#8217;t exist and be so accessible to so many people at once.</p>
<p>Of course, this isn&#8217;t to say that freedom at the endpoint doesn&#8217;t carry with it a slew of safety concerns, like viruses and malware&mdash;but these are problems we want to be able to solve without losing the freedom that makes our endpoints as innovative as they are.  Drumbeat should raise awareness about this notion because it&#8217;s a freedom most of us take for granted, and it&#8217;s one that could easily disappear if stewards aren&#8217;t there to protect it.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.toolness.com/wp/?feed=rss2&amp;p=659</wfw:commentRss>
		</item>
		<item>
		<title>Flexible Membranes and Catch-alls in JavaScript</title>
		<link>http://www.toolness.com/wp/?p=642</link>
		<comments>http://www.toolness.com/wp/?p=642#comments</comments>
		<pubDate>Wed, 29 Jul 2009 18:19:17 +0000</pubDate>
		<dc:creator>Atul</dc:creator>
		
		<category><![CDATA[Coding]]></category>

		<category><![CDATA[Mozilla]]></category>

		<guid isPermaLink="false">http://www.toolness.com/wp/?p=642</guid>
		<description><![CDATA[One of the recurring issues that the Mozilla platform team has to contend with is the issue of how to allow trusted, privileged JavaScript code to interact with untrusted JavaScript code. Google&#8217;s Caja team actually has to deal with a very similar problem, albeit at a different layer in the technology stack.
This issue is quite [...]]]></description>
			<content:encoded><![CDATA[<p>One of the recurring issues that the Mozilla platform team has to contend with is the issue of how to allow trusted, privileged JavaScript code to interact with untrusted JavaScript code. Google&#8217;s <a href="http://en.wikipedia.org/wiki/Caja_%28programming_language%29">Caja</a> team actually has to deal with a very similar problem, albeit at a different layer in the technology stack.</p>
<p>This issue is quite subtle, and fully explaining it is beyond the scope of this blog post.  If you know JavaScript, I recommend checking out the <a href="http://google-caja.googlecode.com/files/caja-spec-2008-06-07.pdf">Caja Specification</a>, which nicely lays out the problems inherent in running code with different trust levels in the same environment.</p>
<p>Firefox has to deal with this issue because much of it is actually written in JavaScript.  Developers call the JS that powers Firefox <i>chrome JavaScript</i>: it has the ability to write to the filesystem, launch other programs on your computer, and pretty much anything that Firefox itself can do.  The code that runs in web pages, on the other hand, is called <i>content JavaScript</i>.  Chrome and content JS can interact with each other securely thanks to <a href="https://developer.mozilla.org/en/XPConnect_wrappers">XPConnect wrappers</a>: little layers of code that &#8220;wrap&#8221; objects and mediate access between them and the outside world.  The self-proclaimed WrapMaster and implementer of most of these wrappers is <a href="http://blog.mozilla.com/mrbkap/">Blake Kaplan</a>, known in some circles as &#8220;Mr. B-Kap&#8221; (mrbkap).</p>
<p>Google Caja&#8217;s team also has a need for the same kind of functionality, but at a different level: they need to make it possible for web pages themselves able to run code that they don&#8217;t trust, which is useful when creating plug-in frameworks for web applications.  The Caja team calls wrappers <i>membranes</i>&mdash;a word which I find more intuitive than &#8220;wrappers&#8221; because it&#8217;s not an overloaded term in computer science and because its <a href="http://en.wikipedia.org/wiki/Membrane">biological definition</a> closely matches that of its CS counterpart.</p>
<p>As I wrote in <a href="http://www.toolness.com/wp/?p=588">Jetpack: Summer 2009 State of Security, Part 1</a>, the boundary between trusted and untrusted code has been of some concern to the Jetpack project.  Unfortunately, all the XPConnect wrappers currently in Firefox have very specific purposes: for instance, most of them are made expressly to prevent omnipotent chrome code from being exploited by impotent content code. Jetpack&#8217;s needs are unique in that a Jetpack feature should be neither as omnipotent as Firefox, nor as impotent as a web page: ideally, we should follow the <a href="http://en.wikipedia.org/wiki/Principle_of_least_privilege">principle of least privilege</a> and give it the minimum set of capabilities it needs to do its task, and no more.</p>
<p>After talking with the Firefox JS and Google Caja teams, we decided that wrappers were the right kind of solution to Jetpack&#8217;s security challenges.  The problem was, though, that all of Firefox&#8217;s wrappers are in C++, which made them hard to experiment with.  Jetpack is, after all, a Labs project, and as such, we needed a sort of &#8220;flexible membrane&#8221; whose security characteristics we could easily change as the platform evolved.  So we decided to expose some functionality to chrome JavaScript that&#8217;s traditionally only available to C/C++ code.</p>
<p>One nice aspect of the flexible membranes we&#8217;ve created is that they&#8217;re useful for more than just prototyping membranes: they effectively allow chrome JS to create objects with characteristics that the JavaScript language doesn&#8217;t traditionally make room for, like catch-alls for object properties.  Python programmers know of these by names like <tt>__getattr__</tt> and <tt>__setattr__</tt>, and many other dynamic languages have them, but JavaScript doesn&#8217;t&mdash;yet something like them is needed to implement basic Web APIs like <a href="https://developer.mozilla.org/en/DOM/Storage">HTML5 localStorage</a>.  In other words, these flexible membranes should make it easy for us to develop nicer APIs for Jetpack.</p>
<p>If you&#8217;re interested in digging into these flexible membranes, check out our <a href="https://wiki.mozilla.org/Labs/Jetpack/Binary_Components">Binary Components documentation</a> on the wiki.  And feel free to take the pre-compiled component from our <a href="http://hg.mozilla.org/labs/jetpack">HG repository</a> and use it in your own Firefox extensions.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.toolness.com/wp/?feed=rss2&amp;p=642</wfw:commentRss>
		</item>
		<item>
		<title>The Wall of Text on My Business Card</title>
		<link>http://www.toolness.com/wp/?p=618</link>
		<comments>http://www.toolness.com/wp/?p=618#comments</comments>
		<pubDate>Sun, 19 Jul 2009 20:12:05 +0000</pubDate>
		<dc:creator>Atul</dc:creator>
		
		<category><![CDATA[Mozilla]]></category>

		<guid isPermaLink="false">http://www.toolness.com/wp/?p=618</guid>
		<description><![CDATA[At Mozilla we get the opportunity to design the back of our business card.  As I&#8217;ve written about before, Mozilla is a unique hybrid organization with a mission that lots of people don&#8217;t know about.  It&#8217;s often hard to communicate to others in passing, so I decided to put it on my business [...]]]></description>
			<content:encoded><![CDATA[<p>At Mozilla we get the opportunity to design the back of our business card.  As I&#8217;ve <a href="http://www.toolness.com/wp/?p=207">written about before</a>, Mozilla is a unique hybrid organization with a mission that lots of people don&#8217;t know about.  It&#8217;s often hard to communicate to others in passing, so I decided to put it on my business card:</p>
<p><center><a href="http://www.toolness.com/images/20090614161758.jpg"><img src="http://www.toolness.com/images/20090614161758.jpg" width="400"/></a></center></p>
<p>I don&#8217;t really expect many people to read it, but at least it&#8217;s out there for anyone who wants to learn more.  Mozilla gives us a &#8220;budget&#8221; of 250 cards to order, so I&#8217;ve only ordered 75 of these; I&#8217;ll come up with something more visual and fun for the other cards.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.toolness.com/wp/?feed=rss2&amp;p=618</wfw:commentRss>
		</item>
	</channel>
</rss>
