PPAPI
   HOME

TheInfoList



OR:

Google Native Client (NaCl) is a discontinued sandboxing technology for running either a subset of Intel
x86 x86 (also known as 80x86 or the 8086 family) is a family of complex instruction set computer (CISC) instruction set architectures initially developed by Intel based on the Intel 8086 microprocessor and its 8088 variant. The 8086 was intr ...
,
ARM In human anatomy, the arm refers to the upper limb in common usage, although academically the term specifically means the upper arm between the glenohumeral joint (shoulder joint) and the elbow joint. The distal part of the upper limb between th ...
, or MIPS native code, or a portable executable, in a sandbox. It allows safely running
native code In computer programming, machine code is any low-level programming language, consisting of machine language instructions, which are used to control a computer's central processing unit (CPU). Each instruction causes the CPU to perform a ver ...
from a
web browser A web browser is application software for accessing websites. When a user requests a web page from a particular website, the browser retrieves its files from a web server and then displays the page on the user's screen. Browsers are used o ...
, independent of the user
operating system An operating system (OS) is system software that manages computer hardware, software resources, and provides common services for computer programs. Time-sharing operating systems schedule tasks for efficient use of the system and may also i ...
, allowing
web app A web application (or web app) is application software that is accessed using a web browser. Web applications are delivered on the World Wide Web to users with an active network connection. History In earlier computing models like client-serve ...
s to run at near-native speeds, which aligns with Google's plans for
ChromeOS ChromeOS, sometimes stylized as chromeOS and formerly styled as Chrome OS, is a Linux-based operating system designed by Google. It is derived from the open-source ChromiumOS and uses the Google Chrome web browser as its principal user interfa ...
. It may also be used for securing browser plugins, and parts of other applications or full applications such as
ZeroVM ZeroVM is an open source light-weight virtualization and sandboxing technology. It virtualizes a single process using the Google Native Client platform. Since only a single process is virtualized (instead of a full operating system), the startup ...
. 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'' (no longer supported on the
Chrome Web Store Chrome Web Store is Google's online store for its Chrome web browser. As of 2019, Chrome Web Store hosts about 190,000 extensions and web apps. History Chrome Web Store was publicly unveiled in December 2010, and was opened on February 11, 20 ...
). NaCl runs
hardware-accelerated Hardware acceleration is the use of computer hardware designed to perform specific functions more efficiently when compared to software running on a general-purpose central processing unit (CPU). Any transformation of data that can be calcul ...
3D graphics (via
OpenGL ES OpenGL for Embedded Systems (OpenGL ES or GLES) is a subset of the OpenGL computer graphics rendering application programming interface (API) for rendering 2D and 3D computer graphics such as those used by video games, typically hardware-accele ...
2.0), sandboxed local file storage, dynamic loading, full screen mode, and mouse capture. There were also plans to make NaCl available on handheld devices. Portable Native Client (PNaCl) is an architecture-independent version. PNaCl apps are compiled ahead-of-time. PNaCl is recommended over NaCl for most use cases. The general concept of NaCl (running native code in web browser) has been implemented before in
ActiveX ActiveX is a deprecated software framework created by Microsoft that adapts its earlier Component Object Model (COM) and Object Linking and Embedding (OLE) technologies for content downloaded from a network, particularly from the World Wide We ...
, which, while still in use, has full access to the system (disk, memory, user-interface, registry, etc.). Native Client avoids this issue by using sandboxing. An alternative by Mozilla was asm.js, which also allows applications written in C or
C++ C++ (pronounced "C plus plus") is a high-level general-purpose programming language created by Danish computer scientist Bjarne Stroustrup as an extension of the C programming language, or "C with Classes". The language has expanded significan ...
to be compiled to run in the browser and also supports ahead-of-time compilation, but is a subset of JavaScript and hence backwards-compatible with browsers that do not support it directly. On 12 October 2016, a comment on the Chromium issue tracker indicated that Google's Pepper and Native Client teams had been destaffed. On 30 May 2017, Google announced deprecation of PNaCl in favor of WebAssembly. Although initially Google planned to remove PNaCl in first quarter of 2018, and later in the second quarter of 2019, it has been removed in June 2022 (together with Chrome Apps).


Overview

Native Client is an open-source project being developed by
Google Google LLC () is an American Multinational corporation, multinational technology company focusing on Search Engine, search engine technology, online advertising, cloud computing, software, computer software, quantum computing, e-commerce, ar ...
. To date, '' Quake'', '' XaoS'', ''
Battle for Wesnoth ''The Battle for Wesnoth'' is a free and open-source turn-based strategy video game with a high fantasy setting, designed by Australian-American developer David White and first released in June 2003. In ''Wesnoth'', the player attempts to build ...
'', '' Doom'', '' Lara Croft and the Guardian of Light'', ''
From Dust ''From Dust'' is a god video game, designed by Éric Chahi and developed by Ubisoft Montpellier. The game was released for Microsoft Windows, PlayStation Network, and Xbox Live Arcade in 2011. Described as a spiritual successor to '' Populous' ...
'', and
MAME MAME (formerly an acronym of Multiple Arcade Machine Emulator) is a free and open-source emulator designed to recreate the hardware of arcade game systems in software on modern personal computers and other platforms. Its intention is to preserve ...
, as well as the sound processing system
Csound Csound is a domain-specific computer programming language for audio programming. It is called Csound because it is written in C, as opposed to some of its predecessors. It is free software, available under the LGPL-2.1-or-later. Csound was o ...
, have been ported to Native Client. Native Client has been available in the Google Chrome web browser since version 14, and has been enabled by default since version 31, when the Portable Native Client (PNaCl, pronounced: pinnacle) was released. An
ARM In human anatomy, the arm refers to the upper limb in common usage, although academically the term specifically means the upper arm between the glenohumeral joint (shoulder joint) and the elbow joint. The distal part of the upper limb between th ...
implementation was released in March 2010.
x86-64 x86-64 (also known as x64, x86_64, AMD64, and Intel 64) is a 64-bit version of the x86 instruction set, first released in 1999. It introduced two new modes of operation, 64-bit mode and compatibility mode, along with a new 4-level paging ...
,
IA-32 IA-32 (short for "Intel Architecture, 32-bit", commonly called i386) is the 32-bit version of the x86 instruction set architecture, designed by Intel and first implemented in the 80386 microprocessor in 1985. IA-32 is the first incarnation o ...
, and MIPS are also supported. To run an application portably under PNaCl, it must be compiled to an architecture-agnostic and stable subset of the
LLVM LLVM is a set of compiler and toolchain technologies that can be used to develop a front end for any programming language and a back end for any instruction set architecture. LLVM is designed around a language-independent intermediate repre ...
intermediate representation An intermediate representation (IR) is the data structure or code used internally by a compiler or virtual machine to represent source code. An IR is designed to be conducive to further processing, such as optimization and translation. A "good" ...
bytecode Bytecode (also called portable code or p-code) is a form of instruction set designed for efficient execution by a software interpreter. Unlike human-readable source code, bytecodes are compact numeric codes, constants, and references (norma ...
. The executables are called PNaCl executables (pexes). The PNaCl Toolchain makes .pexe files; NaCl Toolchain .nexe files. The magic number of .nexe files is 0x7F 'E' 'L' 'F', which is
ELF An elf () is a type of humanoid supernatural being in Germanic mythology and folklore. Elves appear especially in North Germanic mythology. They are subsequently mentioned in Snorri Sturluson's Icelandic Prose Edda. He distinguishes "ligh ...
. In Chrome, they are translated to architecture-specific executables so that they can be run. NaCl uses software
fault detection and isolation Fault detection, isolation, and recovery (FDIR) is a subfield of control engineering which concerns itself with monitoring a system, identifying when a fault has occurred, and pinpointing the type of fault and its location. Two approaches can be ...
for sandboxing on x86-64 and ARM. 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. 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. Because of these constraints, C and C++ code must be recompiled to run under Native Client, which provides customized versions of the GNU toolchain, specifically
GNU Compiler Collection The GNU Compiler Collection (GCC) is an optimizing compiler produced by the GNU Project supporting various programming languages, hardware architectures and operating systems. The Free Software Foundation (FSF) distributes GCC as free softwar ...
(GCC),
GNU Binutils The GNU Binary Utilities, or , are a set of programming tools for creating and managing binary programs, object files, libraries, profile data, and assembly source code. Tools They were originally written by programmers at Cygnus Solutions. ...
, and
LLVM LLVM is a set of compiler and toolchain technologies that can be used to develop a front end for any programming language and a back end for any instruction set architecture. LLVM is designed around a language-independent intermediate repre ...
. Native Client is licensed under a
BSD-style license BSD licenses are a family of permissive free software licenses, imposing minimal restrictions on the use and distribution of covered software. This is in contrast to copyleft licenses, which have share-alike requirements. The original BSD lice ...
. Native Client uses
Newlib Newlib is a C standard library implementation intended for use on embedded systems. It is a conglomeration of several library parts, all under free software licenses that make them easily usable on embedded products. It was created by Cygnus S ...
as its
C library The C standard library or libc is the standard library for the C programming language, as specified in the ISO C standard. ISO/IEC (2018). '' ISO/IEC 9899:2018(E): Programming Languages - C §7'' Starting from the original ANSI C standard, it was ...
, but a port of GNU C Library (GNU libc) is also available.


Pepper

NaCl denotes sodium chloride, common table
salt Salt is a mineral composed primarily of sodium chloride (NaCl), a chemical compound belonging to the larger class of salts; salt in the form of a natural crystalline mineral is known as rock salt or halite. Salt is present in vast quant ...
; as a
pun A pun, also known as paronomasia, is a form of word play that exploits multiple meanings of a term, or of similar-sounding words, for an intended humorous or rhetorical effect. These ambiguities can arise from the intentional use of homophoni ...
, the name of
pepper Pepper or peppers may refer to: Food and spice * Piperaceae or the pepper family, a large family of flowering plant ** Black pepper * ''Capsicum'' or pepper, a genus of flowering plants in the nightshade family Solanaceae ** Bell pepper ** Chili ...
was also used. Pepper API is a cross-platform, open-source API for creating Native Client modules. Pepper Plugin API, or PPAPI is a cross-platform API for Native Client-secured web browser plugins, first based on Netscape's
NPAPI Netscape Plugin Application Programming Interface (NPAPI) was an application programming interface (API) of the web browsers that allows plugins to be integrated. Initially developed for Netscape browsers, starting in 1995 with Netscape Navigato ...
, then rewritten from scratch. It was used in Chromium and Google Chrome to enable the PPAPI version of
Adobe Flash Adobe Flash (formerly Macromedia Flash and FutureSplash) is a multimedia software platform used for production of animations, rich web applications, desktop applications, mobile apps, mobile games, and embedded web browser video players. Fla ...
and the built-in PDF viewer.


PPAPI

On 12 August 2009, a page on Google Code introduced a new project, Pepper, and the associated Pepper Plugin API (PPAPI), "a set of modifications to NPAPI to make plugins more portable and more secure". This extension is designed specifically to ease implementing out-of-
process A process is a series or set of activities that interact to produce a result; it may occur once-only or be recurrent or periodic. Things called a process include: Business and management *Business process, activities that produce a specific se ...
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. *Standardize rendering using the browser's compositing process. *Defining standardized events, and 2D rasterizing functions. *Initial attempt to provide 3D graphics access. *Plugin registry. The Pepper API also supports
Gamepad A gamepad is a type of video game controller held in two hands, where the fingers (especially thumbs) are used to provide input. They are typically the main input device for video game consoles. Features Gamepads generally feature a set o ...
s (version 19) and
WebSocket WebSocket is a computer communications protocol, providing full-duplex communication channels over a single TCP connection. The WebSocket protocol was standardized by the IETF as in 2011. The current API specification allowing web applications ...
s (version 18). , Google's open source browser, Chromium, was the only web browser to use the new browser plug-in model. As of 2020, Pepper is supported by Chrome, Chromium and Blink layout engine-based browsers such as Opera and Microsoft Edge. In August 2020, Google announced that support for PPAPI would be removed from Google Chrome and Chromium in June 2022.


PPAPI in Firefox

Firefox Mozilla Firefox, or simply Firefox, is a free and open-source web browser developed by the Mozilla Foundation and its subsidiary, the Mozilla Corporation. It uses the Gecko rendering engine to display web pages, which implements current ...
developers stated in 2014 that they would not support Pepper, as there is no full specification of the API beyond its implementation in Chrome, which itself is designed for use with Blink layout engine only, and has private APIs specific to the Flash Player plugin which are not documented. In October 2016 Mozilla announced that it had re-considered and was exploring whether to incorporate the Pepper API and PDFium in future releases of Firefox, however no such steps were taken.


Applications

One website uses NaCL on the server to let users experiment with the Go programming language from their browsers.


Reception

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


Supporters

Chad Austin (of
IMVU IMVU (, stylized as imvu) is an online virtual world and social networking site. IMVU was founded in 2004 and was originally backed by venture investors Menlo Ventures, AllegisCyber Capital, Bridgescale Partners, and Best Buy Capital.
) 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 (besides
JavaScript JavaScript (), often abbreviated as JS, is a programming language that is one of the core technologies of the World Wide Web, alongside HTML and CSS. As of 2022, 98% of websites use JavaScript on the client side for webpage behavior, of ...
).
Id Software id Software LLC () is an American video game developer based in Richardson, Texas. It was founded on February 1, 1991, by four members of the computer company Softdisk: game programmer, programmers John Carmack and John Romero, game designer T ...
's John D. Carmack praised Native Client at
QuakeCon QuakeCon is a yearly convention held by ZeniMax Media to celebrate and promote the major franchises of id Software and other studios owned by ZeniMax. It includes a large, paid, bring-your-own-computer ( BYOC) LAN party event with a competitiv ...
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."


Detractors

Other IT professionals are more critical of this sandboxing technology as it has substantial or substantive interoperability issues.
Mozilla Mozilla (stylized as moz://a) is a free software community founded in 1998 by members of Netscape. The Mozilla community uses, develops, spreads and supports Mozilla products, thereby promoting exclusively free software and open standards, w ...
's vice president of products,
Jay Sullivan A jay is a member of a number of species of medium-sized, usually colorful and noisy, passerine birds in the Crow family, Corvidae. The evolutionary relationships between the jays and the magpies are rather complex. For example, the Eurasian m ...
, said that Mozilla has no plans to run 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." Mozilla's
Christopher Blizzard Christopher Blizzard is a Developer Relations lead at Facebook. Formerly, he worked as an Open Source Evangelist at the Mozilla Corporation and has contributed to other open source projects, including Red Hat and One Laptop Per Child. Prior to ...
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 ActiveX is a deprecated software framework created by Microsoft that adapts its earlier Component Object Model (COM) and Object Linking and Embedding (OLE) technologies for content downloaded from a network, particularly from the World Wide We ...
technology, plagued with
DLL Hell In computing, DLL Hell is a term for the complications that arise when one works with dynamic-link libraries (DLLs) used with Microsoft Windows operating systems, particularly legacy 16-bit editions, which all run in a single memory space. DLL Hel ...
. 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."


Second generation

The second generation of sandboxing developed in Google is gVisor. It is intended to replace NaCl in
Google Cloud Google Cloud Platform offers numerous integrated cloud-computing services, including compute, network, and storage. Products Past and present products under the Google Cloud platform include: Current * Google Cloud Datastore, a NoSQL databa ...
, to be more exact in
Google App Engine Google App Engine (often referred to as GAE or simply App Engine) is a cloud computing platform as a service for developing and hosting web applications in Google-managed data centers. Applications are sandboxed and run across multiple server ...
. Google also has been promoting WebAssembly.


See also

*
Application virtualization Application virtualization is a software technology that encapsulates computer programs from the underlying operating system on which they are executed. A fully virtualized application is not installed in the traditional sense, although it is sti ...
* Emscripten *
Sandboxie Sandboxie Plus (formerly Sandboxie) is an open-source OS-level virtualization solution for Microsoft Windows. It started out as a sandboxing solution that creates an isolated operating environment in which applications can run without permane ...
, running Windows programs in a sandbox * WebAssembly, a bytecode standard for web browsers *
XAML Browser Applications XAML Browser Applications (XBAP, pronounced "ex-bap") are Windows Presentation Foundation (.xbap) applications that are hosted and run inside a web browser such as Firefox or Internet Explorer. Hosted applications run in a partial trust sandbox en ...
(XBAP)


References


External links

* * * * – Technical talk at
Google I/O Google I/O (or simply I/O) is an annual developer conference held by Google in Mountain View, California. "I/O" stands for Input/Output, as well as the slogan "Innovation in the Open". The event's format is similar to Google Developer Day. Hi ...
2009
A list of OSS projects ported to Native ClientNative Client source code in Git


Examples


Folding@homePNaCl examples
(runs in Chrome 31+, PNaCl, i.e. no installation needed)
Native Client SDK Gallerytorapp.info
vector editor, especially powerful for security printing (not PNaCl)
NACLBox
a port of DOSBox to Native Client (PNaCl)
SodaSynth
a synthesizer for Native Client (not PNaCl)
pnacl-amiga-emulator
a port of
UAE The United Arab Emirates (UAE; ar, اَلْإِمَارَات الْعَرَبِيَة الْمُتَحِدَة ), or simply the Emirates ( ar, الِْإمَارَات ), is a country in Western Asia (The Middle East). It is located at th ...
, an
Amiga 500 The Amiga 500, also known as the A500, is the first low-end version of the Amiga home computer. It contains the same Motorola 68000 as the Amiga 1000, as well as the same graphics and sound coprocessors, but is in a smaller case similar to th ...
emulator
Abadía del crimen
a port of the SDL version of Vigasoco (remake of La Abadía del Crimen) to Native Client (PNaCl)
Bennugd
a port of Bennugd Videogames examples to Native Client (PNaCl) {{Web interfaces Computer security software Free software Native Client