The arrival of the following two posts on the same day is just too ironic for me not to write about:
- Web Sockets Now Available In Google Chrome
- Firefox 3.6 FileAPI demo: reading EXIF data from a local JPEG file
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.
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.