Are web standards the new OS APIs?

The arrival of the following two posts on the same day is just too ironic for me not to write about:

More and more it seems that APIs which have existed for decades on all POSIX systems (which includes all popular OSes except Windows) are being re-implemented as web standards. This is an interesting trend, which I think is being fueled by a confluence of factors:

  • Adapting to a new reality – Most of the APIs that are being rewritten were originally written many years before even geeks had computers. Today, the masses are online and this means a new security module and different APIs than we had before. The fact that web APIs are further insulated from the OS through a guardian process (the browser) is an example of this trend toward added layers of security.
  • Promoting change on stagnant platforms – It is hard to add default POSIX support to a platform that doesn’t want it. Of course I’m talking about Windows, which hasn’t adopted POSIX support in the default install despite the clear cross-platform development wins. Fortunately, Windows still lets us run applications, so browsers are being enlisted as the agents of change on a platform otherwise unwilling to get with the times. Since Microsoft won’t bring open, cross-platform APIs to its operating system, browsers will do it for them.
  • Moving to a more accessible platform – The browser is a very accessible platform for developers. The browser contains its own runtime environment for JavaScript and rendering engine for HTML. In contrast, programming to the OS APIs on most computers (ie. those running Windows) requires that the user download a compiler and IDE and learn how to use them. Microsoft has failed to provide a generative OS platform, causing many would-be programmers to gravitate toward the web as a platform. With the web, example code is everywhere you look; just view the source. With OS programming, example code is not loaded on the system (in the case of Windows) or if it is available, it is not easily-accessible from the GUI (as in the case of most free operating systems). One Laptop per Child is attempting to change that by providing easy-to-access Python source for all their apps. For aspiring programmers who don’t have an XO, the web is likely to remain the platform of choice.
  • The need for GUI standards – As anyone who has tried programming a graphical user interface for multiple platforms will tell you, we could use some widely-adopted standards in this area. Each operating system has its own GUI API: the Windows API on Windows, Cocoa in Mac OS X, and GTK and Qt in most Linux distributions. While some of these are cross-platform (such as GTK and Qt), they can lose the native “look and feel” and none of them are truly standards because there is only one implementation. In contrast, the POSIX APIs have several independent and interoperable implementations, making them well-established standards. While browser vendors and standards bodies continue to work out the kinks, HTML and JavaScript (along with their counterparts) form an excellent base platform for quickly constructing graphical interfaces that run on any computer. Now that many smartphones ship with full-blown web browsers, web pages are more cross-platform than ever.

Overall, I think this trend toward web standards replacing OS APIs is a big win for everyone. Developers can write one set of code for virtually all platforms, and computers users benefit from a wider selection of software. Operating system vendors can no longer stifle progress by failing to agree on standards, as long as everyone somehow gets a modern browser on their desktop (either by themselves or shipped with their computer). There is still some work to do here, but I’m confident we can get over that hurdle in the next few years, aided by projects like Google Chrome Frame.

Google is betting big on exactly this trend with Chrome OS. Users will not have access to OS APIs; instead, the browser will provide all the APIs they need, including those for local storage, video playback, and 3D gaming. Initially Google intends for a Chrome OS device to be a secondary computer, but with advances in web standards, it could eventually replace a person’s primary computer entirely.

As a person who spends most of his time programming with OS APIs, my optimism toward these web standards trends is of the “cautiously optimistic” form. While one can do a lot with web APIs, they hide a lot of the inner workings of the computer from the programmer, making performance tuning and debugging difficult in some cases. As a result, the programmers of the future may never know exactly how the computer works, trusting that the browser is doing the right thing. Developing the browser components (renderer, video codecs, GUI glue) will be left to an elite few, just as the C library and kernel are left to an elite few today. But isn’t specialization good? Is this trend really such a bad thing? I don’t have the answer. Time will tell.

1 Response to “Are web standards the new OS APIs?”


  • Where you are optimistic, I’d say I’m pessimistic.

    While I agree with the generative properties of webdev (that’s why my first serious start was there), there are many things the web cannot and should not be good at:

    * Efficiency (there are at least two more layers between you and the metal)
    * Privacy (think crypto applications, etc)
    * Language choice (no, ruby in silverlight does not even close to count)

    If you add enough low-level hooks to fix these, you lose the ease/security benefits you like so much.

    The web is great, but I really hope we don’t make it so good that we build everything there. Computers can do better.

Leave a Reply