Many libraries and other valuable code is written in languages that have hitherto been difficult to integrate into Web-based client applications. For example, C and C++ graphics libraries often take advantage of low-level hardware to maximize performance.
In a recently open-sourced project, Google engineers want to enable Web applications, running inside a browser, to safely benefit from such code. In a recent blog post, Google's Native Client is described as:
An open-source research technology for running x86 native code in web applications, with the goal of maintaining the browser neutrality, OS portability, and safety that people expect from web apps...
[It is] a technology that aims to give web developers access to the full power of the client's CPU while maintaining the browser neutrality, OS portability and safety that people expect from web applications.
In a related article, Google engineers describe the sorts of applications that could benefit from this capability:
We believe that the ability to safely run fast native code in a browser has the potential to provide benefits to users and developers.
For example, imagine that you run a photo-sharing website and want to let your users touch up their photos without leaving your site. Today, you could provide this feature using a combination of JavaScript and server side processing. This approach, however, would cause huge amounts of image data to be transferred between browser and the server, leading to an experience that would probably be painfully slow for users who just want to make a few simple changes. With the ability to seamlessly run native code on the user's machine, you could instead perform the actual image processing on the desktop CPU, resulting in a much more responsive application by minimizing data transfer and latency.
The current release of Native Client consists of a runtime environment, a set of compiler tools based on the open-source GCC compiler, and a browser plugin. Native applications created with these tools run in Firefox, Safari, and Google's Chrome browser, on any x86-based system and OS.
Native Client joins a crowded field of projects aimed to bring existing native code (primarily C and C++ code) to the browser. Earlier this year, Adobe showcased its Alchemy project that lets C and C++ code run inside the open-source Flash Virtual Machine. Still, while Alchemy and other efforts rely on a virtual machine, Google's Native Client takes a more bare-bones route.
Who wants to be the first person (or set of people) that discover that a malicious programmer figured out how to bypass Google's code security? No thanks.
I bet this probably is the precursor to an optimized YouTube client for Chrome. "Use Chrome and Youtube will be faster and work better" is an easy way to increase usage.