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

<channel>
	<title>Infrequently Noted</title>
	<atom:link href="http://infrequently.org/feed/" rel="self" type="application/rss+xml" />
	<link>http://infrequently.org</link>
	<description>Alex Russell on browsers, standards, and the process of progress.</description>
	<lastBuildDate>Thu, 23 May 2013 16:42:43 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>I Swear This Blog Isn&#8217;t About Elections&#8230;</title>
		<link>http://infrequently.org/2013/05/i-swear-this-blog-isnt-about-elections/</link>
		<comments>http://infrequently.org/2013/05/i-swear-this-blog-isnt-about-elections/#comments</comments>
		<pubDate>Thu, 23 May 2013 14:09:59 +0000</pubDate>
		<dc:creator>alex</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://infrequently.org/?p=2068</guid>
		<description><![CDATA[&#8230;but if it were, there would be time to cover the W3C Advisory Board election. This is truly inside-baseball stuff, as most of the AB&#8217;s work happens in member-only areas of the W3C website and most of what they effect is W3C process. So why care? Because spec licensing matters, sadly. Let me first outline [...]]]></description>
				<content:encoded><![CDATA[<p>&#8230;but if it were, there would be time to cover the <a href="http://www.w3.org/2002/ab/">W3C Advisory Board</a> <a href="http://briankardell.wordpress.com/2013/05/23/new-blood-reform-the-w3c-process/">election</a>. This is truly inside-baseball stuff, as most of the AB&#8217;s work happens in member-only areas of the W3C website and most of what they effect is W3C process.</p>
<p>So why care? Because <a href="http://dbaron.org/log/20130522-w3c-licensing">spec licensing matters</a>, sadly.</p>
<p>Let me first outline my view: in an ideal world, specification language for web standards would be in the public domain or dedicated to it. The body of intellectual property that is non-copyright is fought over via an independent process, and to the extent that it accumulates in a standards organization, it should <em>also</em> be possible for the group of members that have contributed to take their ball and start again somewhere else.</p>
<p>Why does this matter? Competition.</p>
<p>Standards bodies should not be insulated from the pressure to try to deliver better results. There are, of course, pathologies around this; some of which are common enough to have names: &#8220;pay for play&#8221;, &#8220;venue shopping&#8221;, etc. But in general, to the extent that many bodies can produce substitue goods, it gives them a reason to differentiate. The concrete example here is WHATWG vs. W3C. I don&#8217;t think it&#8217;s controversial to assert that without the WHATWG, the current W3C would be f&#8217;d. Competition makes everyone better, even for products that are &#8220;free&#8221; for consumers and are the product of community effort.</p>
<p>This, then, is why it&#8217;s such a terrible idea for the W3C&#8217;s Advisory Committee (the people who have some power) to elect representatives to the Advisory Board (who have even more power) that are willing to take the self-interested side of the W3C against liberal licensing of specs over the competition-enabling position that liberal licensing makes everyone better off (to a first approximation).</p>
<p>If you are an AC rep, the time is now to quiz candidates on this point. If you truly think that the W3C is a unique community, it&#8217;s important to realize that what makes it that special is a set of shared values, not a death-grip on legacy intellectual property rights. Fixating on that ownership is the fast-path to making everyone worse off; by the time it truly becomes important, it&#8217;s so likely that the organization that cares about it <em>needs</em> competition to right the ship or get out of the way.</p>
]]></content:encoded>
			<wfw:commentRss>http://infrequently.org/2013/05/i-swear-this-blog-isnt-about-elections/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Case Against Synchronous Worker APIs</title>
		<link>http://infrequently.org/2013/05/the-case-against-synchronous-worker-apis-2/</link>
		<comments>http://infrequently.org/2013/05/the-case-against-synchronous-worker-apis-2/#comments</comments>
		<pubDate>Wed, 15 May 2013 13:28:13 +0000</pubDate>
		<dc:creator>alex</dc:creator>
				<category><![CDATA[standards]]></category>
		<category><![CDATA[webdev]]></category>

		<guid isPermaLink="false">http://infrequently.org/?p=2047</guid>
		<description><![CDATA[Several times in the past few months I&#8217;ve been presented with this question: is it good or useful to provide synchronous APIs to web workers? Having considered the question at some length, it seems to me the answer must now be &#8220;no&#8220;. Consider IndexedDB. It&#8217;s not implemented in any browser yet, but some hard-working sould [...]]]></description>
				<content:encoded><![CDATA[<p>Several times in the past few months I&#8217;ve been presented with this question: is it good or useful to provide synchronous APIs to <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/workers.html">web workers</a>?</p>
<p>Having considered the question at some length, it seems to me the answer must now be &#8220;<em>no</em>&#8220;.</p>
<p>Consider IndexedDB. It&#8217;s not implemented in any browser yet, but some hard-working sould did the arduous work to <a href="http://www.w3.org/TR/IndexedDB/#sync-database">specify a second synchronous version of its API</a> which is meant to be available only in Workers where it can&#8217;t lock up the UI thread. That spec work was probably done because it was thought that a synchronous API would be nicer to use than the async version. As a result, the API is now double the size, but only in some contexts. I came across this while attempting to <a href="https://github.com/slightlyoff/DOMFuture/tree/master/reworked_APIs/IndexedDB">rework the IDB API to use Futures</a> in order to improve usability in a backwards-compatible way.</p>
<p>So why not the sync version? At least 2 reasons:</p>
<ul>
<li>The async version doesn&#8217;t have to be thorny as the current IDB API is. The current IDB API has its issues: it uses events for one-time operations (not 0-through-N times operations). To do so it has to create non-obvious control flow contracts to give developers a place to set up listeners. Another legacy of using events is that delivered values are always wrapped in event objects and must be dug out with boilerplate. Some API conveniences can be added, and some things in the API are implicit that perhaps shouldn&#8217;t be (e.g. transactions). All of these things can be repaired in a backwards-compatible way that improves async IDB to the point of being nearly as nice to use as sync IDB. <a href="https://github.com/slightlyoff/DOMFuture/tree/master/reworked_APIs/IndexedDB">Futures</a> can help, as can some reworking of optional arguments.</li>
<li>There&#8217;s very little a worker will do that is really long running and <em>truly</em> synchronous. Even things that look like they&#8217;re a good fit at first blush break down quickly. Just think of the user experience: who wants their laptop fan spinning up, their lap getting warm, and their precious battery indicator slipping towards a powerless coma without being able to either find what is causing it or, better, some UI that communicates what work is being done on their behalf and a way to cancel it if necessary. Getting work off the main thread is what allows apps to do work for users without locking up those UI indicators, but to provide any ability to interrupt the task or broadcast progress, it must yield to the main event loop.</li>
</ul>
<p>It&#8217;s this second concern that I think it truly fatal to the cause of sync worker APIs: assuming they work and are popular, they will create a world in which it&#8217;s necessary to put limits on their overall running time&#8230;limits that will be circumvented by breaking up the work into smaller chunks and dealing with it asynchronously inside the worker. Likewise, anyone building a serious app that&#8217;s trying to do the right thing by the user will factor their worker&#8217;s tasks into small enough chunks that they can both service &#8220;stop&#8221; messages and distribute progress notifications to the UI. There might be scenarios where such messages aren&#8217;t necessary and where users aren&#8217;t coveting CPUs and batteries&#8230;where sending SIGHUP doesn&#8217;t matter. But the intersection of those scenarios and the client-side web seems mostly to be a happy accident: your code might not have encountered enough data to create the problems. Yet.</p>
<p>This is particularly clear in the IDB cases: upgrading, iterating over, and updating hundreds of thousands of items of data is the sort of thing that will take a while, and is likely in response to some application semantic the user cares about: synchronizing mail, migrating to a faster schema layout in the process of some upgrade, etc. A blind <code>for</code> loop is asking for trouble. All of this might work fine in a dev environment with a (small) staging set of data&#8230;but it&#8217;s recipe for disaster when power-users with tons of data encounter it. What then? If the APIs an app depends on are all synchronous, it&#8217;s a huge boulder to roll up a hill to provide notifications, chunk up work, and refactor around async-ish patterns that chunk work up. If the work was async in the first place, the burden is much lower. So even apps that aren&#8217;t Doing It Right (TM) are likely to reap some benefit down the line from thinking in terms of async first.</p>
<p>There are other arguments that you can field against these sorts of APIs, particularly ones that double-up API surface area, but it doesn&#8217;t seem to me that they&#8217;re necessary. The person attempting to justify synchronous worker APIs who provides a good argument for ergonomics and learnability still has all their work ahead of them: they must show that these APIs are not harmful to the user experience. After all, Workers were added to the platform as a way of improving UX (by moving work off the main thread). And I fear they cannot do so without violating core JS semantics.</p>
<p>So let&#8217;s pour one out for our sync API dreams: we&#8217;re gonna miss you, control flow integration. But not for too long. <a href="http://wiki.ecmascript.org/doku.php?id=harmony:proposals"><code>Generators</code>, <code>iterators</code>, and <code>yield</code> will see you avenged</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://infrequently.org/2013/05/the-case-against-synchronous-worker-apis-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Why What You&#8217;re Reading About Blink Is Probably Wrong</title>
		<link>http://infrequently.org/2013/04/probably-wrong/</link>
		<comments>http://infrequently.org/2013/04/probably-wrong/#comments</comments>
		<pubDate>Wed, 03 Apr 2013 21:00:17 +0000</pubDate>
		<dc:creator>alex</dc:creator>
				<category><![CDATA[opensource]]></category>
		<category><![CDATA[openweb]]></category>
		<category><![CDATA[standards]]></category>
		<category><![CDATA[webdev]]></category>
		<category><![CDATA[work]]></category>

		<guid isPermaLink="false">http://infrequently.org/?p=2005</guid>
		<description><![CDATA[By now you&#8217;ve seen the news about Blink on HN or Techmeme or wherever. At this moment, every pundit and sage is attempting to write their angle into the annoucement and tell you &#8220;what it means&#8221;. The worst of these will try to link-bait some &#8220;hot&#8221; business or tech phrase into the title. True hacks [...]]]></description>
				<content:encoded><![CDATA[<p>By now you&#8217;ve seen the news about <a href="http://chromium.org/blink">Blink</a> on HN or Techmeme or wherever. At this moment, every pundit and sage is attempting to write their angle into the annoucement and tell you &#8220;what it means&#8221;. The worst of these will try to link-bait some &#8220;hot&#8221; business or tech phrase into the title. True hacks will weave a Google X and Glass reference into it, or pawn off some &#8220;GOOGLE WEB OF DART AND NACL AND EVIL&#8221; paranoia as prescience (sans evidence, of course). The more clueful of the ink-stained clan will constrain themselves to objective reality and instead pen screeds for/against diversity despite it being a <a href="http://ccs.mit.edu/papers/CCSWP135.html">well-studied topic</a> to <a href="http://scholar.google.com/scholar?cites=5594983873856483033&#038;as_sdt=2005&#038;sciodt=0,5&#038;hl=en">which they&#8217;re not adding much</a>.</p>
<p>May the deities we&#8217;ve invented forgive us for the tripe we&#8217;re about to sell each other as &#8220;news&#8221;.</p>
<p>What&#8217;s bound to be missing in most of this coverage is what&#8217;s plainly said, if not in so many words, in the <a href="http://blog.chromium.org/2013/04/blink-rendering-engine-for-chromium.html">official blog post</a>: <em>going faster matters</em>.</p>
<p>Not (just) code execution, but <em>cycle times</em>: how long does it take you to build a thing you can try out, poke at, improve, or demolish? We mere humans do better when we have directness of action. <a href="http://vimeo.com/36579366">This is what Bret Victor points us towards</a> &#8212; the inevitable constraints of our ape-derived brains. Directness of action <em>matters</em>, and when you&#8217;re swimming through build files for dozens of platforms you don&#8217;t work on, that&#8217;s a step away from directness. When you&#8217;re working to fix or prevent regressions you can&#8217;t test against, that&#8217;s a step away. When compiles and checkouts take too long, that&#8217;s a step away. When landing a patch in both WebKit and Chromium stretches into a multi-day dance of flags, stub implementations, and dep-rolls, that&#8217;s many steps away. And each step hurts by a more-than-constant factor.</p>
<p>This hit home for me when I got my first workstation refresh. I&#8217;d been working on Chrome on Windows for nearly a year in preparation for the Chrome Frame release, and all the while I&#8217;d been hesitant to ask for one of the shiny new boxes that the systems people were peddling like good-for-you-crack &#8212; who the hell was I to ask for new hardware? They just gave me this shiny many-core thing a year ago, after all. And I had a linux box besides. And a 30&#8243; monitor. What sort of unthankful bastard asks for more? Besides, as the junior member of the team, surely somebody else should get the allocation first. </p>
<p>Months later they gave me one anyway. Not ungrateful, I viewed the new system with trepidation: it&#8217;d take a while to set up and I was in the middle of a marathon weekend debugging session over a crazy-tastic re-entracy bug in a GCF interaction with <code>urlmon.dll</code> that was blocking the GCF launch. If there was a wrong time to change horses, surely this was it. At some point it dawned that 5-10 minute link times provided enough time to start staging/configuring at the shiny i7 box.</p>
<p>A couple of hours later the old box was still force-heating the eerily dark, silent, 80-degree floor of the SF office &#8212; it wasn&#8217;t until a couple of weeks later that I mastered the after-hours A/C &#8212; when my new, <em>even hotter</em> workstation had an OS, a checkout, compiler, and <a href="http://msdn.microsoft.com/en-gb/windows/hardware/gg463009.aspx">WinDBG + cargo-culted symserver config</a>. One build on the new box and I was <em>hooked</em>. </p>
<p>5-10 minute links went to 1-2&#8230;and less in many cases because I could now enable incremental linking! And HT really worked on the i7&#8242;s, cutting build times further. Hot damn! In what felt like no-time at all, my drudgery turned to sleuthing/debugging bliss (if there is such a thing). I could make code changes, compile them, and be working with the results in less time than it took to make coffee. Being able to make changes and then <em>feel</em> them near-instantly turned the tide, keeping me in the loop longer, letting me explore faster, and making me less afraid to change things for fear of the time it would take to roll back to a previous state. It wasn&#8217;t the webdev nirvana of ctrl-r, but it was <em>so</em> liberating that it nearly felt that way. What had been a week-long investigation was wrapped up in a day. The launch was un-blocked (at least by that bug) and the world seemed new. </p>
<p>The difference was directness.</p>
<p>The same story repeats itself over and over again throughout the history of Chrome: shared-library builds, ever-faster workstations, trybots and then faster trybots, <a href="https://code.google.com/p/gyp/">gyp</a> (instead of Scons), many different forms of distributed builds, make builds for gyp (courtesy of Evan Martin), <a href="http://clang.llvm.org/">clang</a>, and of course <a href="http://martine.github.com/ninja/">ninja</a> (also Evan&#8230;dude&#8217;s a <em>frickin hero</em>). Did I mention faster workstations? They&#8217;ve made all the same sort of liberating difference. Truly and honestly, in ways I cannot describe to someone who has not felt the difference between ctrl-r development and the traditional Visual Studio build of a massive project, these are the things that change your life for the better when you&#8217;re lashed to the mast of a massive C++ behemoth.</p>
<p>If there is wisdom in the Chrome team, it is that these projects are not only recognized as important, but the very best engineers volunteer to take them on. They seem thankless, but Chrome is an environment that rewards this sort of group-adaptive behavior: the highest good you can do as an engineer is to make your fellow engineers more productive.</p>
<p>And that&#8217;s what you&#8217;re missing from everything else you&#8217;re reading about this announcement today. To make a better platform faster, you must be able to iterate faster. Steps away from that are steps away from a better platform. Today&#8217;s WebKit defeats that imperative in ways large and small. It&#8217;s not anybody&#8217;s fault, but it <em>does</em> need to change. And changing it will allow us to iterate faster, working through the annealing process that takes a good idea from drawing board to API to refined feature. We&#8217;ve always enjoyed this freedom in the Chromey bits of Chrome, and unleashing Chrome&#8217;s Web Platform team will deliver the same sorts of benefits to the web platform that faster iteration and cycle times have enabled at the application level in Chrome.</p>
<p>Why couldn&#8217;t those cycle-time-improving changes happen inside WebKit? After all, much work has happened in the past 4 years (often by Googlers) to improve the directness of WebKit work: EWS bots, better code review flow, improved scripts and tools for managing checkins, the commit queue itself. The results have been impressive and have enabled huge growth and adoption by porters. WebKit now supports multiple multi-process architecture designs, something like a half-dozen network stack plug-ins, and similar diversity at every point where the engine calls back to outside systems for low-level implementation (GPU, network, storage, databases, fonts&#8230;you name it). The community is now committed to enabling porters, and due to WebKit&#8217;s low-ish level of abstraction each new port raises the tax paid by every other port. As <a href="https://plus.google.com/104985880647110483202/posts">James Robinson</a> has observed, this diversity creates an ongoing drag when the dependencies are intertwined with core APIs in such a way that they can bite you every time you go to make a change. The <a href="http://www.chromium.org/developers/content-module/content-api">Content API boundary</a> is Blink&#8217;s higher-level &#8220;embedding&#8221; layer and encapsulates all of those concerns, enabling much cleaner lines of sight through the codebase and the removal of abstractions that seek only to triangulate between opaque constraints of other ports. Blink gives developers much more assurance that when they change something, it&#8217;s only affecting the things they think it&#8217;s affecting. Moving without fear is the secret of all good programming. Putting your team in a position to move with more surety and less fear is hugely enabling.</p>
<p>Yes, there are losses. Separating ourselves from a community of hugely talented people who have worked with us for years to build a web engine is not easy. The decision was wrenching. We&#8217;ll miss their insight, intelligence, and experience. In all honesty, we may have paid too high a price for too long because of this desire to stay close to WebKit. But whatever the &#8220;right&#8221; timing may have been, the good that will come from this outweighs the ill in my mind.</p>
<p>Others will cover better than I can how this won&#8217;t affect your day-to-day experience of WebKit-derived browser testing, or how it won&#8217;t change the feature-set of Chrome over-night, or how the new feature governance process is more open and transparent. But the most important thing is that we&#8217;ll all be going faster, either directly via Blink-embedding browsers or via benchmarks and standards conformance shaming. You won&#8217;t feel it overnight, but it&#8217;s the sort of change in model that enables concrete changes in architecture and performance and <em>that</em> is something to cheer about &#8212; <a href="http://fronteers.nl/congres/2012/sessions/the-web-platform-and-the-process-of-progress-alex-russell">change is the predicate for positive change, after all</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://infrequently.org/2013/04/probably-wrong/feed/</wfw:commentRss>
		<slash:comments>39</slash:comments>
		</item>
		<item>
		<title>Two Governments, Both Alike In Dignity</title>
		<link>http://infrequently.org/2013/04/two-governments-both-alike-in-dignity/</link>
		<comments>http://infrequently.org/2013/04/two-governments-both-alike-in-dignity/#comments</comments>
		<pubDate>Tue, 02 Apr 2013 15:41:17 +0000</pubDate>
		<dc:creator>alex</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://infrequently.org/?p=1997</guid>
		<description><![CDATA[Disclaimer: I&#8217;m engaged to Frances Berriman, the front-end lead at the UK&#8217;s Government Digital Service. She did not approve this post. It is, however, the product of many of our discussions. You&#8217;ll understand shortly why this is relevant. It seems entirely rational to be skeptical about governments doing things well. My personal life as a [...]]]></description>
				<content:encoded><![CDATA[<p><em>Disclaimer: I&#8217;m engaged to <a href="http://fberriman.com/">Frances Berriman</a>, the front-end lead at the UK&#8217;s Government Digital Service. She did not approve this post. It is, however, the product of many of our discussions. You&#8217;ll understand shortly why this is relevant.</em></p>
<p>It seems entirely rational to be skeptical about governments doing things well. My personal life as a migrant to the UK is mediated by heaving bureaucracies, lawyer-greased wheels, and stupefyingly arbitrary rules. Which is to say nothing of the plights of my friends and co-workers &#8212; Google engineers, mostly &#8212; whose migration stories to the US are horrifying in their idiocy. Both the US and UK seem beholden to big-stupid: instead of trying to attract and keep the best engineers, both countries seem hell-bent to keep them out. Heaven forbid they make things of value <em>here</em> (and pay taxes, contribute to society, etc.)! It takes no imagination whatsoever for me to conjure the banality and cruelty that are the predictable outcomes of inflexible, anachronistic, badly-formulated policy.</p>
<p>You see it perhaps most clearly when this banality is translated to purely transactional mediums. PDFs that you must fax &#8212; only to have a human re-type the results on the other end. Crazy use of phones (of course, only during business hours). Physical mail &#8212; the slowest and worst thing for a migrant like myself &#8212; might be the most humane form of the existing bureaucracy in the US. Your expectations are set at &#8220;paper&#8221;, and physical checks and &#8220;processing periods&#8221; measured in weeks feel somehow of a piece. It has always &#8220;worked&#8221; thus.</p>
<p>It&#8217;s befuddling then to have been a near witness to nothing short of the wholesale re-building of government services here in the UK to be easiest to navigate by these here newfangled computrons. And also just flat-out easy. The mantra is &#8220;digital by default&#8221;, and they seem to be <em>actually pulling it off</em>. Let me count the ways:</p>
<ol>
<li><a href="https://www.gov.uk/government/publications/directgov-2010-and-beyond-revolution-not-evolution-a-report-by-martha-lane-fox">High-level policy support for the effort</a>
</li>
<li>Working in the open. Does your government do its development <a href="https://github.com/alphagov/">on github?</a>
</li>
<li><a href="https://www.gov.uk/designprinciples">Designing services for the humans that use them</a>, not the ones who run them
</li>
<li>Making many processes that were either only-physical or damn infuriating near-trivial to do online
</li>
<li>Making key information <em>understandable</em>. Give the UK <a href="https://www.gov.uk/browse/business/limited-company" target="_new">&#8220;limited corporation&#8221; page</a> a view. Now compare to the <a href="https://www.ftb.ca.gov/businesses/bus_structures/LLCompany.shtml" target="_new">California version</a>. Day, meet night.
</li>
<li>Saving both government <em>and</em> citizens massive amounts of money in the process
</li>
</ol>
<p>They even have a <a href="https://www.gov.uk/government">progress bar</a> for how many of the ministries have been transformed in this way.</p>
<p>Over the same timeframe I&#8217;ve known a few of the good folks who have put themselves in the position of trying to effect changes like this at <a href="http://codeforamerica.org/">Code for America</a>. It&#8217;s anathema in the valley to say anything less than effusive about CFA &#8212; anything but how they&#8217;re doing such good, important work. How CFA has the potential to truly transform the way citizens and government interact. Etc, etc. And it&#8217;s all true. But while CFA has helped many in the US understand the idea that things <em>could</em> be better, the UK&#8217;s <a href="http://digital.cabinetoffice.gov.uk/">Government Digital Service</a> has gone out and <em>done it</em>.</p>
<p>So what separates them?</p>
<p>First, the sizes of the challenges need to be compared. The US has <a href="http://www.wolframalpha.com/input/?i=uk+vs.+us+population">5x the population</a>, an economy that&#8217;s 6x larger, and a federalist structure that makes fixing many problems more daunting than most UK citizens can possibly imagine. Next, it should be noted that London is a better place to try to hire the Right People (TM). Yes, it&#8217;s much more expensive to live here, but software salaries are also much lower (both in relative and absolute terms). There wasn&#8217;t as much tech going on here as in the valley to start with, and the gold-rush to produce shiny but less competent versions of existing websites for world+dog (aka: &#8220;the app ruse&#8221;) hasn&#8217;t created the engineering hiring frenzy here that it has stateside. There&#8217;s also a general distrust in the American psyche about the core proposition of the government doing good things. Public-spiritedness seems to so many of my generation a sort of dusty nostalgia that went the way of hemp and tie-dye. Close encounters with modern American government do little to repair the image.</p>
<p>But all of those seem surmountable. The US has more of everything, including the Right People (TM). Indeed, the UK is managing an entire first-world&#8217;s set of services on a smaller GDP. Why then do US public services, to be blunt, largely still suck?</p>
<p>The largest differences I&#8217;ve observed are about model. Instead of having a mandate to change things from the inside, the organizational clout to do it, and enough budget to make a big dent out of the gates (e.g. <a href="http://www.gov.uk">gov.uk</a>) <a href="http://codeforamerica.org/cities/apply-now/">CFA is in the painful position of needing to be invited</a> while at the same time trying to convince <a href="http://codeforamerica.org/fellows/apply/">talented and civic-minded engineers and designers to work for well below industry pay for a limited time on projects that don&#8217;t exist yet</a>.</p>
<p>Put yourselves in the shoes of a <a href="http://codeforamerica.org/2013-fellows/">CFA Fellow</a>: and your compatriots are meant to help change something important in the lives of citizens of a municipality that has &#8220;invited&#8221; you but which is under no real pressure to change, has likely moved no laws or contracts out of the way to prepare for your arrival, and they know you&#8217;re <a href="http://codeforamerica.org/fellowship-program-timeline/">short-timers</a>. Short-timers that <em>someone else is taking all the risk on and paying for</em>? What lasting change will you try to effect when you know that you&#8217;ve got a year (tops) and that whatever you deliver must be politically palatable to entrenched interests? And what about next year&#8217;s Fellows? What will they be handed to build on? What lasting bit of high-leverage infrastructure and service-design will they be contributing to?</p>
<p>The contrast between that and the uncomfortably-named &#8220;civil servants&#8221; of the GDS could not be more stark. I don&#8217;t get the sense that any of them think their job is a lifetime assignment &#8212; most assume they&#8217;ll be back at agencies any day now, and some of the early crop have already moved on in the way nerds tend to do &#8212; but at the pub they talk in terms of building for a generation, doing work that will last, and changing the entire ethos of the way services are produced and consumed. Doing more human work. And then they wake up the next morning and have the <em>authority and responsibility</em> to go do it.</p>
<p>I don&#8217;t want to be down on CFA. Indeed, it feels very much like the outside-government precursor to the GDS: <a href="http://www.mysociety.org/">mySociety</a>. mySociety was put together by many of the same public-spirited folks who initially built the Alpha of what would a year later become gov.uk and the GDS. Like CFA, mySociety spent years pleading from the outside, making wins where it could &#8212; and in the process refining ideas of what needed to change and how. But it was only once the model changed and they grabbed real leverage that they were able to make lasting change for the better. I fear CFA and the good, smart, hard-working people who are pouring their lives into it aren&#8217;t missing anything but leverage &#8212; and won&#8217;t make the sort of lasting change they want without it. CFA as an organization doesn&#8217;t seem to understand that&#8217;s the missing ingredient. America desperately needs for its public services to make the same sort of quantum leap that the UK&#8217;s are making now. It is such an important project, in fact, that it cannot be left to soft-golved, rose-tinted idealism. People&#8217;s lives are being made worse by mis-placed public spending, badly executed projects, and government services that seem to treat service as an afterthought. CFA <em>could</em> be changing this, and we owe it to ourselves and our friends there to ask clearly why that change hasn&#8217;t been forthcoming yet.</p>
<p>The CFA Fellows model has no large wins under its belt, no leverage, and no outward signs of introspection regarding its ability to deliver vs. the GDS model. Lets hope something larger is afoot beneath that placid surface.</p>
<p><b>Update:</b> I failed to mention in the first version of this post that the one of the largest philosophical differences between the two countries is the respective comfort levels with technocratic competence. There exists a strain of fatalism about government in the US that suggests that because government doesn&#8217;t often do things well, it shouldn&#8217;t try. It&#8217;s a distillation of the stunted worldviews of the libertarian and liberal-tarian elite and it pervades the valley. Of course governments that nobody expects anything of will deliver crappy service; how could it be otherwise?</p>
<p>What one witnesses here in the UK is the belief that regardless of what some theory says, it&#8217;s a problem when government does its job badly. To a lesser degree than I sense in years past, but still markedly moreso than in the US, the debate here isn&#8217;t about <em>can</em> the government get good at something, but <em>why isn&#8217;t it better at the things the people have given it responsibility for</em>?</p>
<p>As a result, the question quickly turns how one can expect a government to manage procurement of technical, intricate products for which it&#8217;s the only buyer (or supplier) without the competence to evaluate those products &#8212; let alone manage operations of them. Outsourcing&#8217;s proponents had their go here and enormous, open-ended, multi-year contracts yielded boondoggle after boondoggle. By putting contractors in a position of power over complexity, and starving the in-house experts of staffing and resources to match, the government forfeited it&#8217;s ability to change its own services to meet the needs of citizens. What changed with gov.uk was that the government decided that it <em>had to get good at the nuts and bolts of delivering the services</em>, outsourcing bits and pieces of small work, but owning the whole and managing it in-house. Having the Right People (TM) working on your team matters. If they&#8217;re at a contractor, they have a different responsibility and fiduciary duty. When the ownership of the product is mostly in-house, ambiguities borne of incomplete contract theory are settled in favor of the citizen (or worst case, government) interest, not the profit motive.</p>
<p>The gov.uk folks say &#8220;government should only do what only government can do&#8221;, but my observation has been that that&#8217;s not the end of the discussion: doing it well and doing it badly are still differentiable quantities. And doing better by citizens is <em>good</em>. Clearing space to do good is the essential challenge.</p>
]]></content:encoded>
			<wfw:commentRss>http://infrequently.org/2013/04/two-governments-both-alike-in-dignity/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Cassowary on NPM</title>
		<link>http://infrequently.org/2013/02/cassowary-on-npm/</link>
		<comments>http://infrequently.org/2013/02/cassowary-on-npm/#comments</comments>
		<pubDate>Mon, 04 Feb 2013 14:48:16 +0000</pubDate>
		<dc:creator>alex</dc:creator>
				<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://infrequently.org/?p=1988</guid>
		<description><![CDATA[I continue to work on-and-off on the JS Cassowary port and now, thanks to some help from Isaac, new packages are up on NPM. The API is still marginally unstable and I expect we&#8217;ll be undergoing re-licensing sometime in the near future, but it&#8217;s very near a 0.1 release.]]></description>
				<content:encoded><![CDATA[<p>I continue to work on-and-off on the JS <a href="https://github.com/slightlyoff/cassowary-js-refactor">Cassowary port</a> and now, thanks to some help from <a href="http://izs.me/">Isaac</a>, <a href="https://npmjs.org/package/cassowary">new packages are up on NPM</a>. The API is still marginally unstable and I expect we&#8217;ll be undergoing re-licensing sometime in the near future, but it&#8217;s very near a 0.1 release.</p>
]]></content:encoded>
			<wfw:commentRss>http://infrequently.org/2013/02/cassowary-on-npm/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Reforming the W3C TAG</title>
		<link>http://infrequently.org/2012/12/reforming-the-w3c-tag/</link>
		<comments>http://infrequently.org/2012/12/reforming-the-w3c-tag/#comments</comments>
		<pubDate>Fri, 07 Dec 2012 12:24:34 +0000</pubDate>
		<dc:creator>alex</dc:creator>
				<category><![CDATA[openweb]]></category>
		<category><![CDATA[standards]]></category>
		<category><![CDATA[webdev]]></category>

		<guid isPermaLink="false">http://infrequently.org/?p=1958</guid>
		<description><![CDATA[And so it has come to pass that W3C Technical Architecture Group (TAG) elections are afoot. Nominations have ended and the candidates have been announced. There are four seats open and nine candidates running, so it&#8217;s worth understanding why anyone should vote for the reformers (myself, Yehuda Katz, Anne van Kesteren, Peter Linss, and Marcos [...]]]></description>
				<content:encoded><![CDATA[<p>And so it has come to pass that <a href="http://www.w3.org/2001/tag/">W3C Technical Architecture Group (TAG)</a> elections are afoot. Nominations have ended and the <a href="http://www.w3.org/2012/12/03-tag-nominations">candidates have been announced</a>. There are four seats open and nine candidates running, so it&#8217;s worth understanding why anyone should vote for the reformers (myself, <a href="https://plus.sandbox.google.com/106300407679257154689/posts">Yehuda Katz</a>, <a href="http://annevankesteren.nl/">Anne van Kesteren</a>, <a href="http://www.linkedin.com/pub/peter-linss/2/251/956">Peter Linss</a>, and <a href="http://www.linkedin.com/in/marcosc">Marcos Caceres</a>). For general background, see my <a href="http://infrequently.org/2012/11/election-season/">previous post</a>. Here I&#8217;ll include more specifics, so if that sounds boring, <a href="http://www.flickr.com/photos/kittytoes/8247156949/in/pool-99442622@N00/" target="_new">here&#8217;s a kitten!</a></p>
<p>After doing much reading of TAG <a href="http://www.w3.org/2001/tag/tag-weekly">meeting minutes</a>, <a href="http://www.w3.org/2001/tag/">f2f notes</a>, <a href="http://www.w3.org/2001/tag/group/track/">issues</a>, <a href="http://www.w3.org/2001/tag/group/track/products">delivered products</a>, and <a href="http://www.w3.org/2001/tag/findings#approved">findings</a> I&#8217;ve come to a sobering conclusion: the TAG isn’t focused on eliminating the biggest sources of developer pain today. Now, you can argue that this might not be their job, but I won&#8217;t agree. It&#8217;s the TAGs job to help ensure the health of the platform, both for publishers and search engines, but also for authors. And the web as a platform is in some real trouble today.</p>
<p>There doesn&#8217;t seem to be a sense of urgency in the TAG about the corrosive effects of poor design and integration on the overall usability and health of the system. The Web to the TAG, as I can understand it through the meeting minutes and notes, is a collection of documents that represent internally-referential collections of data which are are linked to other documents, not a series of applications that are attempting ever more impressive feats of richness on a platform that stymies them every time you hit one of the seams. In reality it is (aspirationally) both things but the very real tensions between them don&#8217;t appear in the TAG&#8217;s work, leading me to believe that it doesn&#8217;t comprehend the latter aspect of web development today and what that means for the future health and viability of the platform.</p>
<p>I drone <a href="http://infrequently.org/2012/04/bedrock/">on</a> and <a href="http://infrequently.org/2012/04/one-for-dave-and-david/">on</a> and <em><a href="http://infrequently.org/2012/11/layers-of-confusion/">on</a></em> about layering because explaining each bit of the platform in terms of the one below it relieves much of the tension created by disconnected declarative forms and APIs. This matters because in today&#8217;s web when you go <em>ever so slightly</em> off the path paved by a spec&#8217;s use-cases, the drop-off is impossibly steep, and the only way to keep from risking life-threatening abstraction level transitions is to flood the entire canyon with JavaScript and hope you can still swim in the resulting inland sea of complexity. This is what our biggest, &#8220;best&#8221; webapps do today, relying on ENORMOUS piles of JavaScript that largely serve to re-create what browsers already do in the hopes of marginally extending that capability. It&#8217;s simply nuts, but the TAG doesn&#8217;t seem to acknowledge the threat this poses to everything it holds dear: linking, declarative forms, data&#8230;it&#8217;s all about to be lost beneath the waves, and because the TAG doesn&#8217;t understand the growing importance of JS, it seemingly doesn&#8217;t see the threat. Declarative forms disappear first beneath imperatively-delivered complexity; lingua-franca APIs next. Without ways of getting what your app needs while keeping one foot on the declarative path, app developers do what they must; declarative data and relationships become &#8220;nice to haves&#8221; not &#8220;the way you do it&#8221;. Layering provides easy steps between the levels of abstraction, avoiding the need to re-create what the platform was already doing for you along with whatever custom thing you need &#8212; and it&#8217;s not the TAG&#8217;s current agenda.</p>
<p>If elected, I will work to fix that. The TAG is the right group to formulate and articulate a theory of good layering in the web platform&#8217;s architecture and it&#8217;s the only group at the W3C whose mission is to help spec authors wrestle with large-scale design and integration problems like this. My background is in apps, and JS, and browsers, and I work at one of the few places deeply invested in ensuring that we maintain a healthy, declarative web for the future. I care tremendously about the viability of the largely-declarative web. Through my work with Dimitry Glazkov and many others on Web Components I&#8217;ve done as much as anyone in the last decade to help build a bridge between the JS and declarative worlds. Dimitry and I created and led the team here at Google that have put Shadow DOM, CSS Variables, Custom Elements, Mutation Observers (and Object.observe) into specs and on the platform agenda, all with the explicit goal of creating better layering; explaining the magic in today&#8217;s platform and drawing connections between the bits that had none before. And I think we need to keep building more of those bridges, but it&#8217;s hard when W3C culture views that agenda with suspicion. Why would any WG concern itself with integration with specs outside its charter? It&#8217;s the TAGs job to inject that global perspective. I believe the TAG should pursue the following work as a way of filling its <a href="http://www.w3.org/2004/10/27-tag-charter.html">charter</a>:</p>
<ul>
<li><b>Getting reconnected to web developers</b>: <a href="http://www.w3.org/2001/tag/">today&#8217;s TAG</a> isn&#8217;t composed of web developers (<a href="http://www.youtube.com/watch?v=Ug6XAw6hzaw&#038;t=1m29s" target="_new">Sir Tim excepted</a>) and the general level of familiarity on the committee with the pressing issues in web development seems low. As a member I&#8217;ll press to ensure that at least one of the face-to-face meetings each year overlaps with an industry web development conference (not an academic symposium). Having the TAG simply go and listen, and perhaps answer questions in such a forum, would do much to illuminate the gulf in understanding. I also support <a href="http://marcosc.com/2012/12/w3c-tag-elections/">Marco&#8217;s agenda</a> of direct developer outreach (G+, AMA, IRC, etc.)</li>
<li><b>Forming and expressing an opinion about idiomatic JS APIs</b>: the W3C is the body that specifies JavaScript&#8217;s largest, most important standard library yet it doesn&#8217;t seem to treat that task with any care. Poor integration with JS types, idioms, library conventions, and calling conventions are the calling card of W3C APIs. The detrimental effects are pervasive and corrosive. The TAG should produce a guide on designing idiomatic JS APIs for WGs to use. Additionally, the TAG should use its spec review perch to call out poorly designed JS APIs as such and propose changes that improve full-stack integration. Lastly, the TAG should be open to facilitating (or teaching!) classes on how to design good APIs for the web. It&#8217;s a skill that can be learned like any other, and the TAG has  a unique responsibility towards ensuring that the next generation of APIs is better than the last.</li>
<li><b>Bridge building to TC39</b>: I&#8217;ve served on ECMA TC39 &#8212; the standards body for JavaScript &#8212; since 2007 and in that time I&#8217;ve seen how the dysfunctional relationship with the W3C enables terrible API design. Needless to say, the results haven&#8217;t been great. For a small taste, go look at some <a href="http://www.html5rocks.com/en/tutorials/indexeddb/todo/">IndexedDB samples</a>. There are dozens of terrible DOM APIs (from the perspective of JS) and JS fails to help describe interfaces well enough (from the perspective of DOM). The impasse has even <a href="http://www.w3.org/TR/WebIDL/">been codified</a>. For the sake of the platform and the developers who must use it, we need to do better. I will push to ensure that at least one of the face-to-face meetings of TC39 each year overlaps with a TAG meeting. I&#8217;m hopeful that with my fellow TC39 delegate (Yehuda Katz) and the maintainer of DOM (Anne van Kesteren) also on the TAG, we can make serious progress on this front, actively building a culture of understanding between TC39 and the W3C and furthering the common goal of a web that&#8217;s competitive and well integrated.</li>
<li><b>Advocate for layering</b>: it&#8217;s the TAGs natural role to advocate for coherence in the platform, not only at the markup level, but also inside the app runtime bits that take up so very much of the time in W3C&#8217;s most active WGs. If the TAG doesn&#8217;t do this, asking the important questions at the right time and working to show the benefits of collaboration and cross-API thinking, who will? To combat this, I propose that the TAG take as an open issue the lack of coherence in the client side platform and work to identify the largest developer pain-points in findings that work to set an agenda for WGs in the future. There is no hope for a well-integrated, layered platform without every WG accepting some responsibility for the usability and layering commons, and if elected I will work to ensure the TAG is a tireless advocate for that commons.</li>
</ul>
<p>If that sounds like meaningful progress to you, I&#8217;d appreciate your organization&#8217;s vote; along with your consideration to vote for my fellow reformers: Yehuda Katz, Anne van Kesteren, Peter Linss, and Marcos Cáceres. AC reps for each organization can <a href="https://www.w3.org/2002/09/wbs/33280/tag-20121203/">vote here</a> and have 4 votes to allocate in this election. Voting closes near the end of the month, and it&#8217;s also holiday season, so if you work at a <a href="http://www.w3.org/Consortium/Member/List">member organization</a> and aren&#8217;t the AC rep, please, find out who that person in your organization is and make sure they vote. The TAG can&#8217;t fix the web or the W3C, but I believe that with the right people involved it can do a lot more to help the well-intentioned people who are hard at work in the WGs to build in smarter ways that pay all of us back in the long run.</p>
]]></content:encoded>
			<wfw:commentRss>http://infrequently.org/2012/12/reforming-the-w3c-tag/feed/</wfw:commentRss>
		<slash:comments>22</slash:comments>
		</item>
		<item>
		<title>Origin(al) Sins</title>
		<link>http://infrequently.org/2012/12/original-sins/</link>
		<comments>http://infrequently.org/2012/12/original-sins/#comments</comments>
		<pubDate>Tue, 04 Dec 2012 13:01:52 +0000</pubDate>
		<dc:creator>alex</dc:creator>
				<category><![CDATA[google]]></category>
		<category><![CDATA[openweb]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[talks]]></category>
		<category><![CDATA[work]]></category>

		<guid isPermaLink="false">http://infrequently.org/?p=1949</guid>
		<description><![CDATA[Video is now up from a talk I gave in October at OWASP&#8217;s AppSec USA conference &#8212; something of a departure from my usual speil: Origin(al) Sins &#8211; Alex Russell from OWASP AppSec USA on Vimeo. I made some pretty glaring errors in the talk: you can&#8217;t combine sandboxing with seamlessness for cross-origin content. It&#8217;s [...]]]></description>
				<content:encoded><![CDATA[<p>Video is now up from a talk I gave in October at OWASP&#8217;s AppSec USA conference &#8212; something of a departure from my usual speil:</p>
<p><iframe src="http://player.vimeo.com/video/54157396?badge=0" width="500" height="275" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>
<p><a href="http://vimeo.com/54157396">Origin(al) Sins &#8211; Alex Russell</a> from <a href="http://vimeo.com/appsecusa">OWASP AppSec USA</a> on <a href="http://vimeo.com">Vimeo</a>.</p>
<p>I made some pretty glaring errors in the talk: you can&#8217;t combine sandboxing with seamlessness for cross-origin content. It&#8217;s something I&#8217;m hoping we can improve on in the browsers/specs, but it&#8217;s not the current state of play. I also failed to mention that CSP is Mozilla&#8217;s brain-child and they deserve huge credit for pushing it down the field. Similarly, I failed to mention that IE 10&#8242;s CSP support is actually <a href="http://caniuse.com/contentsecuritypolicy">quite shite, supporting only the <code>sandbox</code> directive</a>. Lastly, my objections to the OCAP worldview may have been oblique so, before the flames arrive in the comments, let me try again:</p>
<p>I think that you&#8217;ll always end up with some variant of &#8220;object capabilities&#8221;, if only through wrapper objects that hide protocol details. The OCAP world calls these &#8220;membranes&#8221; for particularly high-fidelity versions of this. When you have a word for it, it&#8217;s probably common. Vending objects that represent capabilities is natural at some level, but I strongly resist the urge to take the pun too far. Don&#8217;t get me wrong, I&#8217;m a huge fan of capabilities as the model for building apps that have real security by default; and I hope their pervasive use combined with more restrictive, separated execution contexts creates the world we all want to be in. My only quibble is on the developer ergonomics front. OCAP encourages the (perhaps naive) programmer to build many things inside the same &#8220;vat&#8221; (heap, context, whatever), leading to brittleness whereas protocols and true sandboxing can create secure boundaries that, importantly, <em>look</em> like boundaries. Systems that provide big &#8220;this is a security boundary!&#8221; disclaimers on their APIs while making it hard to screw them up stand a better chance of weathering the storms of human imperfection. Can you do OCAP right? Sure, it&#8217;s possible, but as I argue in the  talk, betting on humans to do the right thing is eventually and inevitably a loser. So I favor large, knobby interfaces over which you can send messages and no more. Wrap &#8216;em up with an RPC layer&#8230;cool&#8230;whatever. But design a protocol with side-effects that are straight-forward to reason about on both sides &#8212; not an object which can be easily intertwined with many others in a dense graph &#8212; and you&#8217;ve got my vote. I&#8217;m even in favor of building those protocols and then wrapping them with easier-to-use APIs (call it &#8220;CAP->O&#8221;, if you will), but eliding the step of a large boundary over which you can only send data, and making it relatively hard to cross? Nah, I&#8217;ll be over here with the easy-to-reason about solutions that don&#8217;t make my small-ish brain melt, thanks.</p>
<p>Also, I wasn&#8217;t sure to <a href="https://vimeo.com/channels/appsecusa/54087885">what extent Doug was joking about &#8220;incompetent&#8221; programmers in his talk</a>, so our disagreements may not be what they seem. Caveat emptor.</p>
<p>Thanks to <a href="http://jeremiahgrossman.blogspot.co.uk/">Jeremiah</a> and the other organizers for taking a risk and inviting someone who&#8217;s been out of the security space for so long to give a talk. I promise to them that should they be so foolish in the future, I&#8217;ll be sure to duck out and get one of my betters on the Chrome Security Team to stand in instead ;-)</p>
]]></content:encoded>
			<wfw:commentRss>http://infrequently.org/2012/12/original-sins/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Layers of Confusion</title>
		<link>http://infrequently.org/2012/11/layers-of-confusion/</link>
		<comments>http://infrequently.org/2012/11/layers-of-confusion/#comments</comments>
		<pubDate>Fri, 23 Nov 2012 12:12:36 +0000</pubDate>
		<dc:creator>alex</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://infrequently.org/?p=1941</guid>
		<description><![CDATA[I missed a Plus post by Ian Hickson back from August but I saw it today through the magic of the twitters. It contains quite a lot to quibble about, but I want to home in on something he wrote in the comments in response to Will Sargent, RE: one of my posts on layering [...]]]></description>
				<content:encoded><![CDATA[<p>I missed a Plus post by <a href="https://plus.google.com/107429617152575897589/posts/SiLdNL9MsFw">Ian Hickson back from August</a> but I saw it today through the magic of the twitters. It contains quite a lot to quibble about, but I want to home in on something he wrote in the comments in response to <a href="https://plus.google.com/115037130211259860174/posts">Will Sargent</a>, RE: <a href="http://infrequently.org/2012/04/bedrock/">one of my posts on layering in the platform</a>:</p>
<blockquote><p>
&#8230;I don&#8217;t really share his vision. I think JS is an important part of the Web, but I don&#8217;t see it as any more core to the Web than CSS, HTML, the DOM APIs, HTTP, etc. Most of the proposals I&#8217;ve seen to take JS and build a platform on it tend to fall down on #3, #4, and #5. In particular, I think fundamentally #3 and #4 basically force the platform to have a declarative part (the declarative XAML part of .NET is how it managed to address #4, for instance, and the declarative design of XHTML2 and RDF are how they manage to address #3). That doesn&#8217;t have to mean that the code part is a secondary part, though. I think the Web has reached a point where you can think of the DOM as the core, with JS and the HTML syntax layered atop that (much like how in .NET there&#8217;s objects that can be represented in XAML or generated from C#), which puts the JS part on par with the HTML part in terms of importance to the platform.﻿
</p></blockquote>
<p>This is either me not articulating my &#8220;vision&#8221; clearly, Hixie mis-understanding my point(s), or some combination thereof. So I&#8217;ll try again in 4 paragraphs:</p>
<p>I make no claims about the relative importance of HTML, CSS, JS, DOM or any of the rest. It honestly feels silly to talk about the platform that way. I argue something very, very different: HTML, DOM, and (to a lesser extent) CSS <em>should</em> all conceptually bottom out at JS. I&#8217;m not saying &#8220;go write a browser in JS&#8221;&#8230;that&#8217;s also non-sequitur. JS  must, of course, appeal in turn to C/C++ so a &#8220;browser written in JS&#8221; would need privileged APIs provided by C/C++ or something lower level.</p>
<p>What I&#8217;m saying is something very direct: there&#8217;s no other ubiquitous programming language for the web. JS is the only game in town. As a result, when we describe imperative behavior in prose (as the HTML5 spec does) that behavior could, in theory, be implemented in JS (or some sub/super-set). Since HTML, DOM, and CSS aren&#8217;t Turing-complete, they naturally belong at a &#8220;higher level&#8221; in the web platform stack.</p>
<p>Now, all of this sounds dangerously academic and perhaps nuts&#8230;but consider that we have to expose APIs for nearly all of this stuff. Whenever we add something to HTML, CSS, etc., it always comes with some sort of API. Now, that could be a <em>good</em> API, or it could be an obtuse turn around the parser after some terrible string concatenation. </p>
<p>I&#8217;m claiming that you get better APIs when you design your imperative explanation of the declarative stuff &#8212; which you <em>MUST</em> do for specs to be sane &#8212; in JS. This means designing new APIs to help you accomplish the task at hand as you go. Doing it that way ends you up with the types, APIs, and security boundaries you&#8217;re going to need in the end anyway. Doing it the other way, patching crap onto the side later without explaining how the declarative stuff &#8220;works&#8221;, just leads to the pain and constant need for case-by-case revision that we see in today&#8217;s web APIs.</p>
<p>That&#8217;s the whole argument in 4 &#8216;grafs. It&#8217;s subtle, but I hope not terribly controversial. Importantly, nothing about it demands giving up on <em>any</em> of Hixie&#8217;s 5 arguments. He can keep &#8216;em all and still get a well-layered platform. We&#8217;ve got enough examples of doing it wrong under our belt to see how painful the badly-layered web is today. We can end this insanity &#8212; not by claiming that any part of the platform is &#8220;more important&#8221; &#8212; by explaining the platform in layers, higher levels in terms of the lower levels.</p>
]]></content:encoded>
			<wfw:commentRss>http://infrequently.org/2012/11/layers-of-confusion/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Bits and Remainders</title>
		<link>http://infrequently.org/2012/11/bits-and-remainders/</link>
		<comments>http://infrequently.org/2012/11/bits-and-remainders/#comments</comments>
		<pubDate>Fri, 16 Nov 2012 18:13:03 +0000</pubDate>
		<dc:creator>alex</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://infrequently.org/?p=1934</guid>
		<description><![CDATA[I&#8217;ve been working on an epically-long blog post on the Offline problem for something like two months now and it&#8217;s still not done. That&#8217;s not so much to tease as warn you; Frances thinks I should post it in installments. It&#8217;s that long. Anyhow, as a result of that ever-growing design/analysis/writing hairball, I haven&#8217;t blogged [...]]]></description>
				<content:encoded><![CDATA[<p>I&#8217;ve been working on an epically-long blog post on the Offline problem for something like two months now and it&#8217;s still not done. That&#8217;s not so much to tease as warn you; <a href="http://fberriman.com/">Frances</a> thinks I should post it in installments. It&#8217;s that long.</p>
<p>Anyhow, as a result of that ever-growing design/analysis/writing hairball, I haven&#8217;t blogged when I might have. Notably, videos of some of my recent talks are now up, including my Fronteers closing talk:</p>
<p><iframe src="http://player.vimeo.com/video/53373706?badge=0" width="500" height="281" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>
<p><a href="http://vimeo.com/53373706">Alex Russell | The Web Platform &#038; the Process of Progress | Fronteers 2012</a> from <a href="http://vimeo.com/fronteers">Fronteers</a> on <a href="http://vimeo.com">Vimeo</a>.</p>
<p>Special thanks to <a href="http://peter.sh/">Peter</a> and the Fronteers volunteers for managing to find a <a href="http://instagram.com/p/QZe3keOWcK/">pink <em>boozy</em> cake</a> (a culinary revelation!), simultaneously meeting my only (joke) demand as a speaker and trolling me in person. <em>WELL PLAYED</em>.</p>
<p>Also, give the rest of the <em>excellent</em> talks a <a href="http://vimeo.com/channels/fronteers12">gander over on Vimeo</a> . Personal favorites of mine include <a href="http://vimeo.com/channels/fronteers12/53317254">the ever-brillaint Phil Hawksworth</a>, <a href="http://vimeo.com/channels/fronteers12/53317253">Marcin Wichary&#8217;s stunning Doodles talk</a>, <a href="http://vimeo.com/channels/fronteers12/52882799">Lea Verou</a>, and <a href="http://vimeo.com/channels/fronteers12/53416986">Rebecca Murphey</a>&#8230;.actually, there were too many to list. Seriously, go check it out.</p>
<p>I also recently spoke at the London Ajax User&#8217;s Group, and video is <a href="http://skillsmatter.com/podcast/ajax-ria/the-future-of-the-web-platform">also available</a> (but not embeddable). Apologies for both videos including a lot of me rambling. I need to get better at this whole &#8220;public speaking&#8221; thing.</p>
<p>On a related note, <a href="http://2012.full-frontal.org/">FFJS was once again <em>brilliant</em></a>. Best one day conference going this side of the world, hands down. Congrats to Julie and Remy on a stonkingly good day.</p>
]]></content:encoded>
			<wfw:commentRss>http://infrequently.org/2012/11/bits-and-remainders/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Election Season</title>
		<link>http://infrequently.org/2012/11/election-season/</link>
		<comments>http://infrequently.org/2012/11/election-season/#comments</comments>
		<pubDate>Tue, 06 Nov 2012 20:44:46 +0000</pubDate>
		<dc:creator>alex</dc:creator>
				<category><![CDATA[politics]]></category>
		<category><![CDATA[standards]]></category>

		<guid isPermaLink="false">http://infrequently.org/?p=1924</guid>
		<description><![CDATA[So election season is upon us &#8212; no, not that one &#8212; elections for the W3C&#8217;s Technical Architecture Group (TAG). You might be thinking to yourself &#8220;self, I didn&#8217;t know the W3C had such a thing&#8230;how very strange&#8230;I wonder what it does.&#8221; Also, you might be wondering why I&#8217;d bother to write about a perfunctory [...]]]></description>
				<content:encoded><![CDATA[<p>So election season is upon us &#8212; no, not that one &#8212; elections for the <a href="http://www.w3.org/2001/tag/">W3C&#8217;s Technical Architecture Group (TAG)</a>. You might be thinking to yourself &#8220;<em>self, I didn&#8217;t know the W3C had such a thing&#8230;how very strange&#8230;I wonder what it does.</em>&#8221; Also, you might be wondering why I&#8217;d bother to write about a perfunctory process related to a group whose <a href="http://www.w3.org/2001/tag/doc/PublishingAndLinkingOnTheWeb-20121015.html">deliverables</a> you have probably never encountered in the wild and are fantastically <a href="http://www.w3.org/2001/tag/products/">unlikely to</a>.</p>
<p>The answer is that I&#8217;m now in the running for one of the TAG&#8217;s 4 open seats. At last week&#8217;s TPAC I <strike>was talked</strike> talked myself into running. Google has nominated me, so we&#8217;re off to the proverbial races. Given the number of condolences I&#8217;ve received since deciding to run, you might wonder why I&#8217;d do such at thing at all; particularly since the general consensus is that the TAG&#8217;s impact is somewhere between &#8220;mostly harmless&#8221; and &#8220;harmless&#8221;. I&#8217;ve never heard it described as &#8220;valuable&#8221; or &#8220;productive&#8221; in its modern incarnation, so why run? Could it be for the warmth of human contact that a weekly conference call could provide? A deep-seated but as yet unfulfilled desire to weigh in on what really irks me about how people use HTTP? Indeed not.</p>
<p>I&#8217;m running to try to turn the TAG into an organization that has something to say about the important problems facing devs building apps today; particularly how new specs either address or exacerbate those challenges.</p>
<p>Notionally that&#8217;s what the TAG does now; review specs in development and provide feedback. If you look at the current <a href="http://www.w3.org/2001/tag/products/">work items</a>, however, there&#8217;s nothing about JavaScript. There&#8217;s similarly little on DOM or the sorry state of API design at the W3C and how it is enabled by WebIDL and a broad cultural ignorance of JS. The TAG could provide advice on API design to WGs, how to think about creating a well layered platform, and how to keep webdevs in mind at all times. </p>
<p>State management gets a <a href="http://www.w3.org/2001/tag/doc/IdentifyingApplicationState-20111130">lengthy exposition</a> that doesn&#8217;t do much to uncover the challenges in designing apps that need to keep and manage state, synchronize that state in local data models, and map state onto URLs. Its a hard problem that most JS-driven apps struggle with and the TAG has no view beyond motherhood, apple pie, and pushState(). It can do better.</p>
<p>For webdevs, the TAG is a natural ally &#8212; it carries the weight of the W3Cs reputation in ways that vendor-motivated WGs don&#8217;t. It can be an advocate for building things well to reluctant managers and organizations, helping you make the &#8220;environmentalist&#8221; argument; &#8220;the web is for everyone, why are you making it bad?&#8221; It can also be a go-between for agitated webdevs and the WGs, a voice of reason and patient explanation.</p>
<p>As a talking shop, the TAG can never be expected to have power over implementations or webdevs, but it can be opinionated. It can take a stand on behalf of webdevs and call out huge problems in specs, missing work items for WGs, and build bridges to the framework authors that are doing the heavy lifting when the browsers don&#8217;t. It can also build bridges to other standards bodies that specify hugely important parts of the web platform, bringing a webdev perspective to bear. </p>
<p>I have worked inside a browser, represented Google at TC39, and have built large apps and frameworks on the web stack. I have seen firsthand how the TAG isn&#8217;t doing this important work of building bridges and jawboning on behalf of web developers. And I plan to fix it, if elected.</p>
<p>If you work at a company that is a member of the W3C, I hope to get your AC rep&#8217;s vote. If not, I would still love your support in letting AC reps from <a href="http://www.w3.org/Consortium/Member/List">the Member organizations</a> know that you support the goal of turning the TAG into an advocacy organization for the interests of webdevs.</p>
<p>If you&#8217;re <em>particularly</em> interested in this problem, I&#8217;d love your help &#8212; I&#8217;m looking for reformist-minded candidates to join me in running for the TAG. If you don&#8217;t have a sponsoring or nominating organization, send me mail or a tweet.</p>
<p><strong><em>Voting nitty-gritty</em></strong>, largely cribbed from Ian Jacob&#8217;s <a href="https://lists.w3.org/Archives/Member/w3c-ac-members/2012OctDec/0038.html">mail to a Members-only W3C mailing list</a>:</p>
<ul>
<li><b>Nominations</b>: any Member organization may nominate <em>one</em> individual to serve on the TAG. That nominating organization is expected to cover their nominee&#8217;s costs for the period of service, so don&#8217;t nominate in haste. Nominations are currently open and close on Nov 30th.
</li>
<li><b>Voting</b>: only Advisory Committee members from Member organizations can vote on the TAG elections. It&#8217;s not clear when voting starts but it ends on January 31st, 2013. So if you have an opinion about this, find your AC rep (or one from a company you think should be voting here) and let them know how you feel.
</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://infrequently.org/2012/11/election-season/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Inadmissible Arguments</title>
		<link>http://infrequently.org/2012/08/inadmissible-arguments/</link>
		<comments>http://infrequently.org/2012/08/inadmissible-arguments/#comments</comments>
		<pubDate>Wed, 15 Aug 2012 14:16:04 +0000</pubDate>
		<dc:creator>alex</dc:creator>
				<category><![CDATA[standards]]></category>
		<category><![CDATA[webdev]]></category>

		<guid isPermaLink="false">http://infrequently.org/?p=1896</guid>
		<description><![CDATA[I spend a lot of time working in, on, and around web standards. As a part of this work, several bogus perspectives are continuously deployed to defend preferred solutions. I hereby call bullshit on the following memetic constructs: &#8220;That&#8217;s just a browser caching problem.&#8221; Look for this to be deployed along standards-wonk classics such as [...]]]></description>
				<content:encoded><![CDATA[<p>I spend a lot of time working in, on, and around web standards. As a part of this work, several bogus perspectives are continuously deployed to defend preferred solutions. I hereby call bullshit on the following memetic constructs:</p>
<h2>&#8220;That&#8217;s just a browser caching problem.&#8221;</h2>
<p>Look for this to be deployed along standards-wonk classics such as &#8220;our job should just be to provide low-level primitives&#8221;, &#8220;we don&#8217;t know enough to solve this&#8221;, and &#8220;people will just write tiny libraries to provide that&#8221;.</p>
<p>&#8220;It&#8217;s a caching problem&#8221; is a common refrain of those who don&#8217;t build apps and aren&#8217;t judged on their latency. And it&#8217;s <em>transparently</em> bullshit in the web context. It relies on you forgetting &#8212; for just that split second while it sounds possible to duck the work at hand &#8212; that we&#8217;re talking about a platform whose primary use-case is sending content across a narrow, high-latency pipe. If you work in web standards and <em>don&#8217;t</em> acknowledge this constraint, you&#8217;re a menace to others.</p>
<p>Recent history alone should be enough to invalidate the caching argument; remember Applets? Yeah, Java had lots of problems on the client side, but what you saw with client-side Java were the assumptions of server-side engineers (who get to control things like their deployment VM versions, their hardware and spindle speeds, etc.) imported to distributed code environments where you weren&#8217;t pulling from a fast local disk in those critical moments when you first introduced your site/app/whatever to the users. Instead, you saw the piles upon piles of JARs that get created when you assume that that next byte is nearly free, that disk is only 10ms away, and that cold startups are the rare case. It worked out predictably and Java-like systems succeed on the client when their cultural assumptions <em>do</em> align with deployment constraints &#8212; Android and iOS are great examples. Their mediated install processes see to it.</p>
<p>Back out here on the wolly web, caching is something that&#8217;s under user control. It <em>must</em> be for privacy reasons, and we know from long experience that <em>users clear their caches</em>. The &#8220;cache&#8221; they can&#8217;t clear is the baseline set of functionality the platform provides &#8212; i.e., the built in stuff on all runtimes developer cares about&#8230;which is what specs can effect (obliquely and with some delay).</p>
<p>By the time you&#8217;re having a serious discussion about adding a thing to a spec among participants who aren&#8217;t obvious bozos, you can bet your sweet ass that the reason it was <em>brought up in the first place</em> is a clear and obvious replication of effort among existing users bordering on the ubiquitous &#8212; often in libraries they use. Saying that someone can write a library rises no higher than mere truism, and saying that a standards body shouldn&#8217;t provide some part of the common features found among those existing libraries because caching will make the cost of those libraries moot is <a href="http://httparchive.org/interesting.php#onLoad">ignorance</a> or standards-jujitsu in an attempt to get a particular proposal shelved for some other reason.</p>
<p>As bad as the above is, consider the (historically prevalent) use of this argument regarding &#8220;why we don&#8217;t need no stinking&#8221; markup features &#8212; just &#8220;fix&#8221; browser caching and &#8220;give me a low-level thing and I&#8217;ll build [rounded-corners, gradients, new layout mechanisms, CSS3d xforms, etc.] myself&#8221;. The subtle bias towards JavaScript and away from a declarative web is one of the worst, most insidious biases of the already enfranchised upper-class of JavaScript-savvy web developers, perpetuating a two-tier web in which &#8220;real engineers&#8221; can do better every year but wherein those same expressiveness and performance gains aren&#8217;t transmitted to folks without CS degrees (yes, I&#8217;m looking straight at you, WebGL). You almost want to give it to them, though, so they&#8217;ll finally come to terms with how wrong they really are about the ability for caching to be &#8220;fixed&#8221;.</p>
<p>We&#8217;ve spent a decade on this &#8212; remember that we&#8217;re all using CDNs, pulling our JS libraries from <a href="https://developers.google.com/speed/libraries/devguide">edge-cached servers with stable URLs for optimal LRU behavior</a>, running minifiers, setting far-forward expires, etc. And that&#8217;s just what webdevs are doing: meanwhile browser vendors have been working day and night to increase the sizes of caches, ensure full caches where possible, and implement sometimes crazy specs that promise to help. It&#8217;s not for lack of trying, but we still don&#8217;t collectively know how to &#8220;fix&#8221; caching.</p>
<p>Think libraries are free? Show me how you&#8217;ll make &#8216;em free and I&#8217;ll start taking you seriously. Until then, bozo bit <em>flipped</em>.</p>
<h2>&#8220;It should have exactly the same API as library X&#8221;</h2>
<p>Similar arguments include &#8220;it <em>must</em> be pollyfillable&#8221;, etc.</p>
<p>Why is this bullshit? Not because it represents an aversion to being caught in an implementation/deployment dead zone &#8212; that&#8217;s a serious concern. Nobody wants a better world dangling out there just beyond reach, waiting for Vendor X to pick it up and implement or for Version Y of Old Browser to die so that 90% of your clients can acces the feature. That&#8217;s where libraries provide great value <em>and will continue to, no matter what the eventual feature looks like</em>. Remember, the dominant libraries in use by developers don&#8217;t have Firefox, Chrome, IE, and Opera-specific versions that you serve up based on client. The platonic ideal is 180-degrees in the other direction: one code base, feature detection, polyfills, progressive enhancement &#8212; basically anything within (and often well outside of) reason to keep from serving differential content. So your library is going to have all those versions <em>anyway</em> until <em>all</em> of your clients have the new-spec version. Optimizing based on existing API design because &#8220;now we can polyfill it without extra effort!&#8221; misunderstands both the role of spec designers and of libraries and serves users very poorly indeed.</p>
<p>Where this argument becomes <em>truly</em> inadmissible, though, is when it seeks to define the problem to be &#8220;what our API already does&#8221;. Turns out that the language you can design features with when all you have is JavaScript and HTML/CSS patterns is&#8230;well&#8230;the JS, HTML, and CSS you have today. Powerful yes. Expressive? Hrm. If your job, however, is to evolve an integrated platform, taking on a constraint predicated on the current form of your systems is nuts. There are some hard constraints like that (backwards compatibility), but adopting some form of hack as the &#8220;blessed&#8221; way of doing something without looking around and going &#8220;how can we do this better given that we have more powerful and expressive language to solve the problem with?&#8221; is nothing but lost opportunity.</p>
<p>Yes, a standards group might look around and go &#8220;nope, we can&#8217;t do better than that polyfill/library&#8221; and adopt the solution wholesale. That&#8217;s not a bad thing. What <em>is</em> bad, though, is advocacy about far-future solutions to current problems based solely on the idea that some library totally nailed it and we shouldn&#8217;t be asking for anything more &#8212; e.g.: Microdata cribbed from RDFa and Microformats when what you <em>really</em> wanted was Web Components. Rote recital of existing practice is predictably weak sauce that robs the platform of its generative spark. We should all be hoping for enhancements that make the future web <em>stronger</em> than today&#8217;s, and you only find those opportunities by taking off the blinders and giving yourself free reign to do things that libraries, polyfills, and hack just can&#8217;t.</p>
<p>What to do about the developers and users caught in the crossfire? Well, we <em>can</em> advocate for degradable, polyfill-friendly designs, but there are limits to that. The most hopeful, powerful way to make the pain disappear is to ensure that more of our users year-over-year are on browsers/platforms that auto-update and won&#8217;t ever be structurally left-behind again. And yes, that&#8217;s something that every web developer should be working towards; prompting users to update to current-version auto-upgrading &#8212; &#8220;evergreen&#8221;, if you will &#8212; browsers. Remember: you get the web you ask your users for.</p>
<h2>&#8220;Just tell us the use cases&#8221;</h2>
<p>This is the one I&#8217;m most sick of hearing from the mouths of standards wonks and authors. What they&#8217;re <em>trying</em> to say is some well-meaning combination of:</p>
<ul>
<li>If you tell us exactly how you&#8217;re doing whatever it is you&#8217;re accomplishing today, we&#8217;ll run the risk of just adopting some API that was designed with some bogus constraints (see above).</li>
<li>We need to communicate to a lot of people involved in this effort why they should care, &#8217;cause putting stuff into browsers is a shitload of work.</li>
</ul>
<p>What it often winds up doing, however, is serving as a way for a standards body or author to shut up unproductive folks; folks who aren&#8217;t willing to do the work of helping them come to enlightenment about the architecture of the current solution, the constraints it was built under, and the deficiencies it leaves you with. Or it can be used to avoid that process entirely &#8212; which is where we&#8217;re getting towards bullshit territory. Taken to the extreme (and it too often is) the &#8220;use-cases, not details&#8221; approach infantilizes standards body participants, setting a bar too high for the folks who are crying out for help and setting the bar too low for the standards body because, inevitably, the tortured text of the &#8220;use cases&#8221; is an over-terse substitue for a process, a <em>way</em> of building, and an architectural approach. Use-cases (as you see them for HTML and CSS in particular) become architecture-free statements, no more informative than a line plucked at random from Henry V. Suggestive, yes. Useful? Nope. The very idea of building standards without a shared concept of architecture is <em>bogus</em>, and standards participants need to stop hiding behind this language. If you don&#8217;t understand something, say so. If many people work hard to explain it and can&#8217;t, <em>ask for a sample application or snippet to hack on</em> so you can do a mind-meld with their code and can ask questions about it in context.</p>
<p>Yes, having the use-cases matters, but nobody should be allowed to pretend that they&#8217;re a substitue for understanding the challenges of an architecture.</p>
<hr />
<p>While I&#8217;ve only covered a few of the very worst spec-building tropes, it&#8217;s by no means the end of the rhetorical shit list. Perhaps this will be a continuing series &#8212; although I&#8217;m sure this post will offend enough folks to make me think twice about it. If we put an end to just these, though, a lot of good could be accomplished. Here&#8217;s to hoping.</p>
]]></content:encoded>
			<wfw:commentRss>http://infrequently.org/2012/08/inadmissible-arguments/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Please Vote</title>
		<link>http://infrequently.org/2012/05/please-vote/</link>
		<comments>http://infrequently.org/2012/05/please-vote/#comments</comments>
		<pubDate>Tue, 01 May 2012 11:30:40 +0000</pubDate>
		<dc:creator>alex</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://infrequently.org/?p=1864</guid>
		<description><![CDATA[If you&#8217;re a web developer, please vote in Paul Irish&#8217;s poll on browser support. The larger the population that votes, the more we can trust the answers, and the data is critical to making sense of how we collectively think about browser support. Go now. It won&#8217;t take long, I promise.]]></description>
				<content:encoded><![CDATA[<p>If you&#8217;re a web developer, please vote in <a href="http://gopollgo.com/what-browsers-do-you-test-your-sites-slash-apps-against">Paul Irish&#8217;s poll on browser support</a>. The larger the population that votes, the more we can trust the answers, and the data is critical to making sense of how we collectively think about browser support. Go now. It won&#8217;t take long, I promise.</p>
]]></content:encoded>
			<wfw:commentRss>http://infrequently.org/2012/05/please-vote/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Class Warfare</title>
		<link>http://infrequently.org/2012/04/class-warfare/</link>
		<comments>http://infrequently.org/2012/04/class-warfare/#comments</comments>
		<pubDate>Mon, 23 Apr 2012 12:23:41 +0000</pubDate>
		<dc:creator>alex</dc:creator>
				<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://infrequently.org/?p=1845</guid>
		<description><![CDATA[We've been debating various forms of classes in JS since the late '90s. That's right; we've been circling this drain for <em>more than a decade</em>...some worry that a form of <code>class</code> in ES6 that doesn't make coffee for you while also shooting rainbows out of it's behind won't be worth the syntactic space it takes up....Rainbow-shooting technology takes a while to build, meanwhile, wouldn't it be great if we could get a cup of joe around here? ]]></description>
				<content:encoded><![CDATA[<p>And so we&#8217;re at an impasse.</p>
<p>At the last TC39 meeting, after spending what felt like an eternity on the important topic of UTF-16 encoding, the last day hastily ended with two topics that simply could not be any more urgent: can we get something done about data mutation observation &#8212; the underpinnings for every data binding system worth a damn &#8212; and classes.</p>
<p>As you might imagine, classes got at least one cold shoulder, but this time we were able to suss out the roots of the objection: the latest majority-agreed proposal (&#8220;<a href="http://wiki.ecmascript.org/doku.php?id=strawman:maximally_minimal_classes" target="_new">Maximally Minimal Classes</a>&#8220;) isn&#8217;t &#8220;high water mark&#8221; classes and, since so much has been given up to get <em>something</em> moved down the field, classes are no longer worth having. In this post I&#8217;ll outline a bit of the debate so far, current state, and hopefully convince you that the anti-classicist&#8217;s arguments are weak.</p>
<p>But first: why classes at all?</p>
<p>There&#8217;s an ambient argument in the JS world that &#8220;we don&#8217;t need no stinking classes&#8221;. That all we must do to save the language is teach people the zen of function objects and closures and all will be well with the world&#8230;and if we lose some people, so what? I don&#8217;t want to tar everyone who sympathizes with the beginning of that sentiment with the obvious negatives of the last bit, but that&#8217;s the overall gist I get. In this view, classes are an unnecessary and lead people to consider JS code the &#8220;wrong&#8221; way. I&#8217;ve written before about how in ES6 <a href="http://infrequently.org/2011/09/why-class-doesnt-mean-what-you-think-it-means/"><em>class means function</em></a>, but that doesn&#8217;t mollify the discontent.</p>
<p>But then why any language feature at all? Why isn&#8217;t assembler good enough for everyone? Or C? Or <a href="https://developers.google.com/native-client/">C++</a>?</p>
<p>Turns out the answer is &#8220;human frailty&#8221;. Or put a different way, the process of cognition depends on very limited amounts of short-term stack space in our wetware, and computing languages are about making the <em>computer</em> hospitable for the <em>human</em>, not about telling the system what to do. Our tradeoffs in languages would look much different if we could all easily recall 20 or 30 things at a time instead of 5-10. Languages are tools for freeing creative people from registers and stacks and heaps and memory management and all the rest; all while trying to keep the creative process grounded in the reality that it&#8217;s memory words in a Von Neumann architecture; without that grounding we&#8217;d end up too disconnected from the system to deliver anything practical.</p>
<p>Abstractions, high-level semantics, types&#8230;they&#8217;re all pivots, ways of considering <em>sets</em> of things while working with an individual example of that thing mentally. You don&#8217;t consider every case all at once and don&#8217;t remember everything about the system at one time; instead you focus on the <em>arguments</em> to the current <em>function</em> which creates it&#8217;s own <em>scope</em>. All of these mechanisms create ways of limiting what you need to think about. They ease the burden of associating some things with other things by allowing you to consider smaller cases and allowing you to create or break limitations as they become variously helpful and harmful to getting something done. And we have <em>lots</em> of words to describe the things we find painful about dealing with the overhead of remembering; of a lack of directness and locality: &#8220;spaghetti code&#8221;, &#8220;unmaintainable&#8221;, &#8220;badly factored&#8221;, &#8220;tightly coupled&#8221;, etc. Where there&#8217;s a new fad in programming, odds are high that it is being touted as a solution to some aggregate behavior which causes a reasonable local decision to become globally sub-optimal. This is what language features are for and why, when you see yourself using the same patterns over and over again, something is deeply wrong.</p>
<p>I&#8217;ll say this again (and imagine me saying it sloooooowly): languages evolve in response to the pain caused by complexity. The corollary is that language which don&#8217;t evolve to remove complexity, or which add it in day-to-day usage cause pain. Pain is almost always bad.</p>
<p>Complexity takes many forms, but the process of disambiguation when looking at a syntactic form that relies on a pattern is one of the easiest to take off the table. You&#8217;ll see this in my work in lots of areas: Web Components make the relationship between markup and eventual behavior less ambiguous when you read the HTML, Shadow DOM creates an isolation boundary for CSS and HTML that make it easier to consider a &#8220;thing&#8221; in isolation when building and using them, classes in JS make it easier to read some bit of code and not be tripped up by the many meanings of the word <code>function</code>, and many of the features I&#8217;ve advocated for in CSS (mixins, hierarchy, variables) are factoring mechanisms that make it simpler to pivot between repeated stuff and the ad-hoc visual semantics of the document that mean so much to the design language.</p>
<p>Not only should we write off the luddites, we should consider every step towards lower complexity <em>good</em> and steps towards complexity and slower understanding to be <em>bad</em> and actively harmful. Tortured claims about how &#8220;you aren&#8217;t going to need those things&#8221; need to be met with evidence; in this case, what do the pervasive libraries in the ecosystem do? Yeah, those are complexity to be taken off the table. The agenda is clear.</p>
<p>But back to classes and JS.</p>
<p>We&#8217;ve been debating various forms of classes in JS since the late &#8217;90s. That&#8217;s right; we&#8217;ve been circling this drain for <em>more than a decade</em>. In that time, nearly every permutation of class system that I&#8217;m familiar with has been debated as the rightful heir to the reserved <code>class</code> keyword. From a parallel inheritance structure (non-prototypal) to &#8220;just prototypes like we have them today&#8221;, from &#8220;classes as constructor body&#8221; to &#8220;classes as object literals with constructors&#8221;, from frozen to gooey and unbaked, from classes as nominal types to totally untyped, we&#8217;ve seen it all. In all of this, the only constant has been failure. TC39 has continued, for more than a decade, to fail to field <em>any</em> class syntax (yes, I have my slice of blame-cake right here). In that time, JS has gone from being important to being <em>critical</em> to the construction of large systems; both on the client and the server. As this has happened, we&#8217;ve seen <code>function</code> pressed into service not only as lambda and method, but module, class, and pretty much every other form of ad-hoc composition system that&#8217;s needed at any point. We&#8217;re overdue for adding language-level support for all of these things. The committee has shown great ability to extend and expand upon idioms already in the language, taking syntax as a starting point and using it create new room for reducing pain (the spread operator and destructuring are great examples). Yet still many on the committee, notably Luke Hoban of Microsoft and Waldemar Horwat of Google, worry that a form of <code>class</code> in ES6 that doesn&#8217;t make coffee for you while also shooting rainbows out of it&#8217;s behind won&#8217;t be worth the syntactic space it takes up. I would have worried about this too back in &#8217;08 when I first attended a TC39 meeting, but no longer. This is a group that is good at incremental change. Rainbow-shooting technology takes a while to build; meanwhile, wouldn&#8217;t it be great if we could get a cup of joe around here? We&#8217;ve waited long enough to get something meaningful to build on and with. <em>I</em> want a hell of a lot more than what the Maximally Minimal Classes proposal adds, but they&#8217;re a starting point, and there will be more ES versions.</p>
<p>So that&#8217;s Argument #1: people will hate us if <code>class</code> doesn&#8217;t do enough.</p>
<p>True, perhaps, but they will hate us anyway. Add classes and Mikeal Rogers personally organizes the pitchfork and torch distribution points and leads the march. Don&#8217;t add classes and the world at large thinks of JS as a joke and a toy &#8212; where&#8217;d that giant library/transpiler get to, anyway? You need <em>something</em> after all. Add them and Mikeal can keep not using classes to his heart&#8217;s content, and if we add classes in the style I prefer (and which Max/Min Classes embody), he can use them <em>as</em> old-skool functions and never care how they were declared; all the while making JS more productive for folks who don&#8217;t want to buy into a whole lifestyle to get a job done.</p>
<p>What&#8217;s Argument #2? That instances created from classes aren&#8217;t frozen. That is to say, it&#8217;s still possible to add new properties to them later. You know, like every other JS object.</p>
<p>If you&#8217;re thinking &#8220;yes, but isn&#8217;t there Object.freeze() already?&#8221;, you&#8217;re not alone. What you&#8217;re witnessing here is a debate about what&#8217;s considered good, not what&#8217;s possible. You can manually freeze/seal objects to your heart&#8217;s content, but what the (tiny) minority that is strenuously making argument #2 is demanding is that nobody be allowed to use the word <code>class</code> to create a constructor function body <em>unless the resulting object is automatically frozen</em>. They are willing to hold up the entire train until this preference is mollifed, and are unhappy with any short syntax which does not bless their preferred style.</p>
<p>In fairness, I also would be grumpy to see things go a direction I don&#8217;t prefer, but consider the following syntaxes that could be deployed in a future version to create frozen classes, none of which are precluded by the Max/Min proposal:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #006600; font-style: italic;">// &quot;const&quot; causes instances to have their properties </span>
<span style="color: #006600; font-style: italic;">// frozen on exiting the constructor</span>
<span style="color: #000066; font-weight: bold;">const</span> <span style="color: #FF0000;">class</span> Point <span style="color: #009900;">&#123;</span>
  constructor<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> ... <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #006600; font-style: italic;">// Declaring a const properties member causes the</span>
<span style="color: #006600; font-style: italic;">// constructor to check for those only, freezing exiting</span>
<span style="color: #006600; font-style: italic;">// the constructor</span>
<span style="color: #FF0000;">class</span> Point <span style="color: #009900;">&#123;</span>
  constructor<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> ... <span style="color: #009900;">&#125;</span>
  <span style="color: #000066; font-weight: bold;">const</span> properties <span style="color: #009900;">&#123;</span>
     <span style="color: #006600; font-style: italic;">// Object literal</span>
     ...
  <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>And I&#8217;m sure you can think of a couple of others. The essential distinguishing feature, and the thing that is holding the entire train up, is that the word <code>class</code> without any embellishment whatsoever doesn&#8217;t work this way. Yes, I know it sounds crazy, but that&#8217;s where we&#8217;re at. You can help, though. Erik Arvidsson has implemented Max/Min classes in <a href="http://code.google.com/p/traceur-compiler/">Traceur</a> and you can try it out in the live <a href="http://traceur-compiler.googlecode.com/git/demo/repl.html">repl</a>. If you like/hate it, won&#8217;t you please let the <a href="https://mail.mozilla.org/listinfo/es-discuss">es-discuss mailing list</a> know? Or just post in the comments here for posterity. We know that these classes need <em>many</em> more features, but your thoughts about this syntax as a starting point couldn&#8217;t be more timely.</p>
]]></content:encoded>
			<wfw:commentRss>http://infrequently.org/2012/04/class-warfare/feed/</wfw:commentRss>
		<slash:comments>34</slash:comments>
		</item>
		<item>
		<title>Hoisted From The Comments</title>
		<link>http://infrequently.org/2012/04/hoisted-from-the-comments/</link>
		<comments>http://infrequently.org/2012/04/hoisted-from-the-comments/#comments</comments>
		<pubDate>Tue, 17 Apr 2012 10:40:49 +0000</pubDate>
		<dc:creator>alex</dc:creator>
				<category><![CDATA[openweb]]></category>
		<category><![CDATA[standards]]></category>
		<category><![CDATA[webdev]]></category>

		<guid isPermaLink="false">http://infrequently.org/?p=1844</guid>
		<description><![CDATA[Some stuff is too good to leave in the shadows. On my Bedrock post, James Hatfield writes in with a chilling point, but one which I&#8217;ve been making for a long while: ”every year we’re throwing more and more JS on top of the web” The way things are going in my world, we are [...]]]></description>
				<content:encoded><![CDATA[<p>Some stuff is too good to leave in the shadows. On my <a href="">Bedrock</a> post, <a href="http://www.emenoh.com/">James Hatfield</a> writes in with a chilling point, but one which I&#8217;ve been making for a long while:</p>
<blockquote><p>
”every year we’re throwing more and more JS on top of the web”</p>
<p>The way things are going in my world, we are looking at replacing the web with JS, not simply layering. At a certain point you look at it all and say “why bother”. Browsers render the DOM not markup. They parse markup. Just cut out the middle man and send out DOM – in the form of JS constructs.</p>
<p>The second part is to stop generating this markup which then must be parsed on a server at the other end of a slow and high latency prone communication channel. Instead send small compact instructions to the browser/client that tells it how to render and when to render. Later you send over the data, when it’s needed&#8230;
</p></blockquote>
<p>This is a clear distillation of what scares me about the road we&#8217;re headed down because for each layer you throw out and decide to re-build in JS, you end up only doing what you <em>must</em>, and that&#8217;s often a deadline-driven must. Accessibility went to hell? Latency isn&#8217;t great? Doesn&#8217;t work at all without script? Can&#8217;t be searched? When you use built-ins, those things are more-or-less taken care of. When we make them optional by seizing the reigns with script, not only do we wind up playing them off against each other (which matters more, a11y or latency?) we often find that developers ignore the bits that aren&#8217;t flashy. Think a11y on the web isn&#8217;t great now? Just wait &#8217;till it&#8217;s <em>all</em> JS driven.</p>
<p>It doesn&#8217;t have to be this way. When we get <a href="http://code.google.com/p/mdv/">Model Driven Views</a> into the browser we&#8217;ll have the powerful &#8220;just send data and template it on the client side&#8221; system everyone&#8217;s looking for but without threatening the searchability, a11y, and fallback behaviors that make the web so great. And this is indicative of a particularly strong property of markup: it&#8217;s about <em>relationships</em>. &#8220;This thing references that thing over there and does something with it&#8221; is hard for a search engine to tease out if it&#8217;s hidden in code, but if you put it in <em>markup</em>, well, you&#8217;ve got a future web that continues to be great for users, the current crop of developers, and whoever builds and uses systems constructed on top of it all later. That last group, BTW, is you if you use a search engine.</p>
<p>But it wasn&#8217;t all clarity and light in the comments. <a href="http://mailmarkup.org/">Austin Cheney</a> <a href="http://infrequently.org/2012/04/one-for-dave-and-david/#comment-239698">commented</a> on the <a href="http://infrequently.org/2012/04/one-for-dave-and-david">last post</a> to say:</p>
<blockquote><p>
This article seems to misunderstand the intention of these technologies. HTML is a data structure and nothing more. JavaScript is an interpreted language whose interpreter is supplied with many of the most common HTML parsers. That is as deep as that relationship goes and has little or nothing to do with DOM.</p>
<p>&#8230;It would be safe to say that DOM was created because of JavaScript, but standard DOM has little or nothing to do with JavaScript explicitly. Since the release of standard DOM it can be said that DOM is the primary means by which XML/HTML is parsed suggesting an intention to serve as a parse model more than a JavaScript helper.</p>
<p>Types in DOM have little or nothing to do with types in JavaScript. There is absolutely no relationship here and there shouldn’t be&#8230;You cannot claim to understand the design intentions around DOM without experience working on either parsers or schema language design, but its operation and design have little or nothing to do with JavaScript. JavaScript is just an interconnecting technology like Java and this is specifically addressed in the specification in Appendix G and H respectively.
</p></blockquote>
<p>And, after <a href="http://infrequently.org/2012/04/one-for-dave-and-david/#comment-239699">I tried to make the case that noting how it is today is no replacement for a vision for how it should be</a>, Austin <a href="http://infrequently.org/2012/04/one-for-dave-and-david/#comment-239701">responds</a>:</p>
<blockquote><p>
The problem with today’s web is that it is so focused on empowering the people that it is forgetting the technology along the way. One school of thought suggests the people would be better empowered if their world were less abstract, cost radically less to build and maintain, and is generally more expressive. One way to achieve such objectives is alter where costs exist in the current software life cycle of the web. If, for instance, the majority of costs were moved from maintenance to initial build then it could be argued that more time is spent being creative instead of maintaining.</p>
<p>I have found that when working in HTML alone that I save incredible amounts of time when I develop only in XHTML 1.1, because the browser tells you where your errors are. &#8230; Challenges are removed and costs are reduced by pushing the largest cost challenges to the front of development.</p>
<p>&#8230; The typical wisdom is that people need to be empowered. If you would not think this way in your strategic software planning then why would it make sense to think this way about strategic application of web technologies? &#8230;
</p></blockquote>
<p>This might all sound very rational on one level, but a few points need to be made:</p>
<ul>
<li>If we&#8217;re not building technology <em>for people</em>, WTF are we doing with these CPU cycles exactly?
</li>
<li>Speed of iteration is a key enabler of progress in any technology stack I&#8217;ve ever worked in
</li>
<li>Strictness fails in the wild
</li>
</ul>
<p>I think Austin&#8217;s point about moving costs from maintenance to build is supposed to suggest that if we were only more strict about things, we&#8217;d have less expensive maintenance of systems, but it&#8217;s not clear to me that this has anything to do with strictness. My observation from building systems is that this has a lot more to do with being able to build modular, isolated systems that compose well. Combine that with systems that let you iterate fast, and you can grow very large things that can evolve in response to user needs without turning into spaghetti quite so quickly. Yes, the web isn&#8217;t great for that today, but strictness is orthogonal. Nothing about <a href="http://dvcs.w3.org/hg/webcomponents/raw-file/tip/explainer/index.html">Web Components</a> demands strictness to make maintainability infinitely better.</p>
<p>And the last point isn&#8217;t news. <a href="http://en.wikipedia.org/wiki/Jon_Postel#Postel.27s_Law">Postel&#8217;s Law</a> isn&#8217;t a plea about what you, dear software designer, <em>should</em> be doing, it&#8217;s an insightful clue into the economics of systems at scale. XML tried being strict and <em>it didn&#8217;t work</em>. Not even for RSS. Mark Pilgrim&#8217;s famously heroic attempts at building a reliable feed parser match the war stories I&#8217;ve heard out of the builders of every large RSS system I&#8217;ve ever talked to. It&#8217;s not that it&#8217;s a nice idea to be forgiving about what you accept, it&#8217;s that there&#8217;s no way around it if you want scale. What Austin has done is the classic bait-and-switch: he has rhetorically substituted what works in his organization (and works well!) for what&#8217;s good for the whole world, or even what&#8217;s plausible. I see this common logical error in many a standards adherent/advocate. They imagine some world in which it&#8217;s <em>possible</em> to be strict about what you accept. I think that world might be possible, but the population would need to be less than the size of a small city. Such a population would never have ever created any of the technology we have, and real-world laws would be how we&#8217;d adjudicate disputes. As soon as your systems and contracts deal with orders of magnitude more people, it <em>pays to be reliable</em>. You&#8217;ll win if you do and lose if you don&#8217;t. It&#8217;s inescapable. So lets banish this sort of small-town thinking to the mental backwaters where it belongs and get on with building things for <em>everyone</em>. After all, this is about people. Helping <em>sentient beings</em> achieve their goals in ways that are both plausible and effective.</p>
<p>If helping people is <em>not</em> what this is about, I want out.</p>
]]></content:encoded>
			<wfw:commentRss>http://infrequently.org/2012/04/hoisted-from-the-comments/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>For Dave and David</title>
		<link>http://infrequently.org/2012/04/one-for-dave-and-david/</link>
		<comments>http://infrequently.org/2012/04/one-for-dave-and-david/#comments</comments>
		<pubDate>Wed, 04 Apr 2012 14:49:16 +0000</pubDate>
		<dc:creator>alex</dc:creator>
				<category><![CDATA[openweb]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[standards]]></category>
		<category><![CDATA[webdev]]></category>

		<guid isPermaLink="false">http://infrequently.org/?p=1819</guid>
		<description><![CDATA[Dave Herman jokingly accused me a couple of TC39 meetings ago of being an &#8220;advocate for JavaScript as we have it today&#8221;, and while he meant it in jest, I guess to an extent it&#8217;s true &#8212; I&#8217;m certainly not interested in solutions to problems I can&#8217;t observe in the wild. That tends to scope [...]]]></description>
				<content:encoded><![CDATA[<p><a href="http://calculist.org/">Dave Herman</a> jokingly accused me a couple of TC39 meetings ago of being an &#8220;advocate for JavaScript as we have it today&#8221;, and while he meant it in jest, I guess to an extent it&#8217;s true &#8212; I&#8217;m certainly not interested in solutions to problems I can&#8217;t observe in the wild. That tends to scope my thinking aggressively towards solutions that look like they&#8217;ll have good adoption characteristics. Fix things that are broken for real people in ways they can understand how to use.</p>
<p>This is why I get so exercised about <a href="http://www.w3.org/TR/WebIDL/">WebIDL</a> and the way it breaks the mental model of JS&#8217;s &#8220;it&#8217;s just extensible objects and callable functions&#8221;. It&#8217;s also why my discussions with folks at last year&#8217;s <a href="http://www.w3.org/2011/11/TPAC/">TPAC</a> were so bleakly depressing. I&#8217;ve been meaning to write about TPAC ever since it happened, but the time and context never presented themselves. Now that I got some of my words out about <a href="http://infrequently.org/2012/04/bedrock/">layering in the platform</a>, the time seems right.</p>
<p>Let me start by trying to present the argument I heard from multiple sources, most likely from (in my feeble memory) <strike><a href="http://annevankesteren.nl/">Anne van Kestern</a></strike> Jonas Sicking(?):</p>
<blockquote><p>
ECMAScript is not fully self-describing. <a href="http://es5.github.com/#x8.6.2">Chapter 8 drives a hole right through the semantics, allowing host objects to whatever they want</a> and more to the point, there&#8217;s no way in JS to describe e.g. list accessor semantics. You can&#8217;t subclass an Array in JS meaningfully. JS doesn&#8217;t follow it&#8217;s own rules, so why should we? DOM is just host objects and all of DOM, therefore, is Chapter 8 territory.
</p></blockquote>
<p>Brain <em>asploded</em>.</p>
<p>Consider the disconnect: they&#8217;re not saying &#8220;oh, it sure would be nice if our types played better with JS&#8221;, they&#8217;re saying &#8220;you and what army are gonna make us?&#8221; Remember, WebIDL isn&#8217;t just a shorthand for describing JavaScript classes, it&#8217;s an <a href="http://www.w3.org/TR/WebIDL/#idl-types">entirely parallel type hierarchy</a>.</p>
<p>Many of the Chapter 8 properties and operations are still in the realm of magic from JS today, and we&#8217;re working to open more of them up over time by giving them API &#8212; in particular I&#8217;m hopeful about Allen Wirfs-Brock&#8217;s work on making array accessors something that we can treat as a protocol &#8212; but it&#8217;s magic that DOM is appealing to and even <a href="http://www.w3.org/TR/WebIDL/#es-platform-objects">specifying itself in terms of</a>. Put this in the back of your brain: DOM&#8217;s authors have declared that they <em>can and will do magic</em>.</p>
<p>Ok, that&#8217;s regrettable, but you can sort of understand where it comes from. Browsers are largely C/C++ enterprises and DOM started in most of the successful runtimes as an FFI call <em>from</em> JS <em>to</em> an underlying set of objects which are owned by C/C++. The truth of the document&#8217;s state was not owned by the JS heap, meaning every API you expose is a conversation with a C++ object, not a call into a fellow JS traveler, and this has profound implications. While we have one type for strings in JS, your C++ side might have <code>bstr</code>, <code>cstring</code>, <code>wstring</code>, <code>std::string</code>, and/or some variant of <code>string16</code>. </p>
<p>JS, likewise, has <code>Number</code> while C++ has <code>char</code>, <code>short int</code>, <code>int</code>, <code>long int</code>, <code>float</code>, <code>double</code>, <code>long double</code>, <code>long long int</code>&#8230;you get the idea. If you&#8217;ve got storage, C++ has about 12 names for it. Don&#8217;t even get me started on <code>Array</code>.</p>
<p>It&#8217;s natural, then, for DOM to just make up it&#8217;s own types so long as its raison d&#8217;être is to front for C++ and not to be a standard library for JS. Not because it&#8217;s malicious, but because that&#8217;s just what one <em>does</em> in C++. Can&#8217;t count on a particular platform/endianness/compiler/stdlib? Macro that baby into submission. <a href="http://code.google.com/searchframe#OAMlx_jo-ck/src/third_party/WebKit/Source/WebCore/platform/">WTF</a>, indeed.</p>
<p>This is the same dynamic that gives rise to the tussle over <a href="http://infrequently.org/2011/10/real-constructors-webidl-last-call/">constructable constructors</a>. To recap, there is no way in JS to create a function which cannot have <code>new</code> on the left-hand-side. Yes, that might return something other than an instance of the function-object on the right-hand side. It might even throw an exception or do something entirely non-sensical, but because <code>function</code> is a JavaScript concept and because all JS classes are <em>just functions</em>, the idea of an unconstructable constructor is entirely alien. It&#8217;s not that you <em>shouldn&#8217;t</em> do it&#8230;the moment to have an opinion about that particular question never arises in JS. That&#8217;s not true if you&#8217;re using magic to front for a C/C++ object graph, though. You <em>can</em> have that moment of introspection, and you can choose to say &#8220;no, JS is wrong&#8221;. And they do, <a href="http://lists.w3.org/Archives/Public/public-script-coord/2011JulSep/thread.html#msg114">over and over</a>.</p>
<p>What we&#8217;re witnessing here isn&#8217;t &#8220;right&#8221; or &#8220;wrong&#8221;-ness. It&#8217;s entirely conflicting world views that wind up in tension because from the perspective of some implementations and all spec authors, the world looks like this:</p>
<p><img src="http://infrequently.org/wp-content/uploads/2012/04/today_small.png" alt="" title="The layers of today&#039;s platform." width="404" height="274" class="aligncenter size-full wp-image-1821"/></p>
<p>Not to go all Jeff Foxworthy on you, but if this looks reasonable to you, <em>you might be a browser developer</em>. In this worldview, JS is just a growth protruding from the side of an otherwise healthy platform. But that&#8217;s not how webdevs think of it. True or not, this is the mental model of someone scripting the browser:</p>
<p><img src="http://infrequently.org/wp-content/uploads/2012/04/a_choice_cut_of_well_marbled_platform.png" alt="" title="The Well-Marbled Platform" width="404" height="275" class="aligncenter size-full wp-image-1824" /></p>
<p>The parser, DOM, and rendering system are browser-provided, but they&#8217;re just JS libraries in some sense. With <code>&lt;canvas&gt;</code>&#8216;s 2D and 3D contexts, we&#8217;re even punching all the way up to the rendering stack with JS, and it gets ever-more awkward the more our implementations look like the first diagram and not the second.</p>
<p>To get from parser to DOM in the layered world, you have to describe your objects <em>as JS objects</em>. This is the disconnect. Today&#8217;s spec hackers don&#8217;t think of their task as the work of describing the imperative bits of the platform in the platform&#8217;s imperative language. Instead, their mental model (when it includes JS at all) pushes it to the side as a mere consumer in an ecosystem that it is not a coherent part of. No wonder they&#8217;re unwilling to deploy the magic they hold dear to help get to better platform layering; it&#8217;s just not something that would ever occur to them.</p>
<p>Luckily, at least on the implementation side, this is changing. Mozilla&#8217;s work on <a href="https://github.com/andreasgal/dom.js">dom.js</a> is but one of <a href="https://github.com/arv/JS-DOM-Test">several</a> projects looking to move the source of truth for the rendering system out of the C++ heap and into the JS heap. Practice is moving on. It&#8217;s time for us to get our ritual lined up with the new reality.</p>
<p>Which brings me too David Flanagan who last fall <a href="https://twitter.com/#!/__DavidFlanagan/status/109415801542557696">asked to read my manifesto on how the platform should be structured</a>. Here it is, then:</p>
<blockquote><p>
The network is our bottleneck and markup is our lingua-franca. To deny these facts is to design for failure. Because the network is our bottleneck, there is incredible power in growing the platform to cover our common use cases. To the extent possible, we should attempt to grow the platform through markup first, since markup provides the most value to the largest set of people and provides a coherent way to expose APIs via DOM.</p>
<p>Markup begets JS objects via a parser. DOM, therefore, is merely the largest built-in JS library.</p>
<p>Any place where you cannot draw a line from browser-provided behavior from a tag to the JS API which describes it is magical. The job of Web API designers is first to introduce new power through markup and second to banish magic, replacing it with understanding. There may continue to be things which exist outside of our understanding, but that is a challenge to be met by cataloging and describing them in our language, not an excuse for why we cannot or should not.
</p></blockquote>
<p>The ground below our feet is moving and alignment throughout the platform, while not inevitable, is clearly desirable and absolutely doable in a portable and interoperable way. Time, then, to start making Chapter 8 excuses in the service of being <em>more</em> idiomatic and <em>better</em> layered. Not less and worse.</p>
]]></content:encoded>
			<wfw:commentRss>http://infrequently.org/2012/04/one-for-dave-and-david/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
	</channel>
</rss>
