Native client

Google Native Client
Developer(s) Google, others
Preview release Pepper 27 / 12 April 2013; 14 months ago (2013-04-12)
Development status Production (NaCl, PNaCl[1])
Written in C, C++
Operating system Cross-platform: Microsoft Windows, Linux, Mac OS, Chrome OS
Type Sandbox in web browsers for native code
License New BSD license
Free software portal

Google Native Client (NaCl) is a sandboxing technology for running a subset of Intel x86 or ARM native code in a sandbox. It is proposed for safely running native code from a web browser, allowing web-based applications to run at near-native speeds,[2] which aligns well with Google's plans with Chrome OS. It may also be used for securing browser plugins, and in the future parts of other applications or full applications.[3]

To demonstrate the readiness of the technology, on 9 December 2011, Google announced the availability of several new Chrome-only versions of games known for their rich and processor-intensive graphics, including Bastion. NaCl runs hardware-accelerated 3D graphics (via OpenGL ES 2.0), sandboxed local file storage, dynamic loading, full screen mode, and mouse capture. There are also plans to make NaCl available on handheld devices.[4][5]

The general concept of NaCl (running native code in web browser) has been implemented before in ActiveX, which, while still in use, has a legacy of DLL hell and security problems. NaCl attempts to not repeat these issues.


Native Client is an open-source project being developed by Google.[6] To date, Quake, XaoS and MAME have been ported to Google Native Client Platform. Native Client was formerly available as an experimental disabled-by-default feature in the Google Chrome web browser.[2] The feature is enabled from version 14 of Chrome; at the same time, native applications can be uploaded to the Chrome Web Store, and with more recent Chrome versions (if enabled in chrome://flags), native client applications can run under Chrome from any web site.[7] When Portable Native Client (PNaCl, pronounced: pinnacle) is released, Chrome will enable Native Client (by default) for all pages and web apps, including those distributed outside the Chrome Web Store.[8] The first public developer preview of PNaCl was in May 2013.[9] Pepper 24 released in December 2012 can build PNaCl executables (pexes), but Chrome did not at that time yet have support for executing them.[10] Thus using pexes required translating them to architecture-specific executables on the server side. Since Chrome 29, the translator is bundled with Chrome, but must still be manually enabled.[9]

An ARM implementation was released in March 2010.[11] x86-64 and IA-32 are also supported. As of March 2011, however, all three implementations could only use code compiled to the host's native instruction set. PNaCl is being developed to address this issue. To run an application portably under PNaCl, it must be compiled to an architecture-agnostic and stable subset of the LLVM intermediate representation bytecode.[12]

NaCl uses software fault isolation for sandboxing on x86-64 and ARM.[13] The x86-32 implementation of Native Client is notable for its novel sandboxing method which makes use of the x86 architecture's rarely-used segmentation facility.[14] Native Client sets up x86 segments to restrict the memory range that the sandboxed code can access. It uses a code verifier to prevent use of unsafe instructions such as those that perform system calls. To prevent the code from jumping to an unsafe instruction hidden in the middle of a safe instruction, Native Client requires that all indirect jumps be jumps to the start of 32-byte-aligned blocks, and instructions are not allowed to straddle these blocks.[14] Because of these constraints, C/C++ code must be recompiled to run under Native Client, which provides customized versions of the GNU toolchain, specifically GCC and binutils as well as LLVM.

Native Client is licensed under a BSD-style license.

Native Client uses Newlib as its C library, but a port of GNU libc is also available.[15]

Since release 0.5, Native Client has a stable ABI.[16] This roughly means that code compiled and running in the NaCl implementation of Google Chrome 14, will work in all future versions of Google Chrome.


NaCl denotes table salt; as a pun, the name of pepper was also used. Pepper API is a cross-platform, open-source API for creating Native Client modules.[17] Pepper Plugin API, or PPAPI[18][19] is a cross-platform API for Native Client-secured web browser plugins, first based on Netscape's NPAPI, then rewritten from scratch. It is currently used in Chromium and Google Chrome to enable the PPAPI version of Flash[20] and the built-in PDF viewer.[21]


On 12 August 2009 a page on Google Code introduced a new project, Pepper with associated Pepper Plugin API (PPAPI),[22] "a set of modifications to NPAPI to make plugins more portable and more secure".[23] This extension is designed specifically to ease the implementation of out-of-process plugin execution. Further, the goals of the project are to provide a framework for making plugins fully cross-platform. Topics considered include:

  • Uniform semantics for NPAPI across browsers.
  • Execution in a separate process from the renderer/browser itself.
  • Standardize rendering using the browser's compositing process.
  • Defining standardized events, and 2D rasterization functions.
  • Initial attempt at providing 3D graphics access.
  • Plugin registry.

The continuously evolving Pepper API also supports Gamepads (version 19) and WebSockets (version 18).[24]

As of 13 May 2010, Google's open source browser, Chromium, was the only web browser to utilize the new browser plug-in model.[25] Mozilla has announced that they are "not interested in or working on Pepper at this time."[26]


Some groups of browser developers support the Native Client technology, but others do not.

Supporters: Chad Austin (of IMVU) praised the way Native Client can bring high-performance applications to the web (with about 5% penalty compared to native code) in a secure way, while also accelerating the evolution of client-side applications by giving a choice of the programming language used (beside JavaScript).[27]

Id Software's John Carmack praised Native Client at QuakeCon 2012, saying: "if you have to do something inside a browser, Native Client is much more interesting as something that started out as a really pretty darn clever x86 hack in the way that they could sandbox all of this in user mode interestingly. It's now dynamic recompilation, but something that you program in C or C++ and it compiles down to something that's going to be not your -O4 optimization level for completely native code but pretty damn close to native code. You could do all of your evil pointer chasings, and whatever you want to do as a to-the-metal game developer."[28]

Detractors: Other IT professionals are more critical of this sandboxing technology as it has substantial or substantive interoperability issues.

Mozilla's vice president of products, Jay Sullivan, said that Mozilla has no intention of running native code inside the browser, as "These native apps are just little black boxes in a webpage. [...] We really believe in HTML, and this is where we want to focus."[29]

Mozilla's Christopher Blizzard criticized NaCl, claiming that native code cannot evolve in the same way that the source code-driven web can. He also compared NaCl to Microsoft's ActiveX technology, plagued with DLL hell.[3] Mozilla currently employs the inventor of JavaScript, Brendan Eich as chief technological officer.

Håkon Wium Lie, Opera's CTO, believes that "NaCl seems to be 'yearning for the bad old days, before the web'", and that "Native Client is about building a new platform – or porting an old platform into the web [...] it will bring in complexity and security issues, and it will take away focus from the web platform."[3]


External links

  • Native Client - Google Developers (Native Client Developer Site)
  • Google Native Client Project Page
  • YouTube
  • Google I/O 2009
  • NaClbox
  • Google Native Client: The web of the future – or the past? (a good overview)


  • Native Client Gallery
  •, vector editor, especially powerful for security printing
  • DOSBox to Native Client
  • SodaSynth, a synthesizer for Native Client

This article was sourced from Creative Commons Attribution-ShareAlike License; additional terms may apply. World Heritage Encyclopedia content is assembled from numerous content providers, Open Access Publishing, and in compliance with The Fair Access to Science and Technology Research Act (FASTR), Wikimedia Foundation, Inc., Public Library of Science, The Encyclopedia of Life, Open Book Publishers (OBP), PubMed, U.S. National Library of Medicine, National Center for Biotechnology Information, U.S. National Library of Medicine, National Institutes of Health (NIH), U.S. Department of Health & Human Services, and, which sources content from all federal, state, local, tribal, and territorial government publication portals (.gov, .mil, .edu). Funding for and content contributors is made possible from the U.S. Congress, E-Government Act of 2002.
Crowd sourced content that is contributed to World Heritage Encyclopedia is peer reviewed and edited by our editorial staff to ensure quality scholarly research articles.
By using this site, you agree to the Terms of Use and Privacy Policy. World Heritage Encyclopedia™ is a registered trademark of the World Public Library Association, a non-profit organization.