Thursday, June 07, 2012

Google Chrome "Native Client": Beyond HTML/JavaScript

Google is re-inventing Java/.NET/ActiveX/Flash...

Technical Overview - Native Client — Google Developers




Native Client product names follow a salt & pepper theme. Native Client, abbreviated to NaCl, started the salt & pepper naming theme.

The Pepper Plug-in API (PPAPI), called Pepper for convenience, is an open-source, cross-platform API for plug-in for web browsers. From the point of view of Native Client, Pepper is a set of APIs that allow a C or C++ Native Client module to communicate with the hosting browser and get access to system-level functions in a safe and portable way. One of the security constraints in Native Client is that modules cannot make any OS-level calls. Pepper provides analogous APIs that modules can target instead. You can use the Pepper APIs to:

  • talk to the JavaScript code in your application from the C++ code in your NaCl module
  • do FileIO
  • play audio
  • render 3D graphics
    The HTML file contains the <embed> tag that loads the Native Client module. For example:
        <embed name="nacl_module"
               id="hello_world"
               width=0 height=0
               src="hello_world.nmf"
               type="application/x-nacl" />
    
    Native Client modules are operating system independent, but they are not (yet) processor independent. Therefore, you must compile separate versions of a Native Client module for x86-32-bit, x86-64-bit, and other instruction sets. The manifest file, specified in the src attribute of the embed tag, specifies which version of the Native Client module to load, depending on the end-user's processor.
  • No comments: