Portable Native Client
   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 8086 microprocessor and its 8-bit-external-bus variant, the 8088. Th ...
,
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 ...
, or MIPS native code, or a portable executable, in a sandbox. It allows safely running
native code In computer programming, machine code is computer program, computer code consisting of machine language instruction set architecture, instructions, which are used to control a computer's central processing unit (CPU). For conventional binary ...
from a
web browser A web browser, often shortened to browser, is an application 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 scr ...
, independent of the user
operating system An operating system (OS) is system software that manages computer hardware and software resources, and provides common daemon (computing), services for computer programs. Time-sharing operating systems scheduler (computing), schedule tasks for ...
, allowing
web app A web application (or web app) is application software that is created with World Wide Web, web technologies and runs via a web browser. Web applications emerged during the late 1990s and allowed for the server to Dynamic web page, dynamically ...
s to run at near-native speeds, which aligns with Google's plans for
ChromeOS ChromeOS, sometimes styled as chromeOS and formerly styled as Chrome OS, is an operating system designed and developed by Google. It is derived from the open-source operating system and uses the Google Chrome web browser as its principal user ...
. 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
game A game is a structured type of play usually undertaken for entertainment or fun, and sometimes used as an educational tool. Many games are also considered to be work (such as professional players of spectator sports or video games) or art ...
s known for their rich and processor-intensive
graphics Graphics () are visual images or designs on some surface, such as a wall, canvas, screen, paper, or stone, to inform, illustrate, or entertain. In contemporary usage, it includes a pictorial representation of the data, as in design and manufa ...
, including ''
Bastion A bastion is a structure projecting outward from the curtain wall of a fortification, most commonly angular in shape and positioned at the corners of the fort. The fully developed bastion consists of two faces and two flanks, with fire from the ...
'' (no longer supported on the
Chrome Web Store Web Store is Google's online store for its Chrome web browser. As of 2024, Chrome Web Store hosts about 138,000 extensions and 33,000 themes. History Chrome Web Store was publicly unveiled in December 2010, and was opened on February 11, 20 ...
). NaCl runs hardware-accelerated 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-accelerate ...
2.0), sandboxed local file storage,
dynamic loading Dynamic loading is a mechanism by which a computer program can, at run time, load a library (or other binary) into memory, retrieve the addresses of functions and variables contained in the library, execute those functions or access those var ...
, full screen mode, and
mouse A mouse (: mice) is a small rodent. Characteristically, mice are known to have a pointed snout, small rounded ears, a body-length scaly tail, and a high breeding rate. The best known mouse species is the common house mouse (''Mus musculus'' ...
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 W ...
, 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 asm.js is a subset of JavaScript designed to allow computer software written in languages such as C to be run as web applications while maintaining performance characteristics considerably better than standard JavaScript, which is the typical l ...
, which also allows applications written in C or C++ 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 WebAssembly (Wasm) defines a portable binary-code format and a corresponding text format for executable programs as well as software interfaces for facilitating communication between such programs and their host environment. The main goal of ...
. 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 was an
open-source Open source is source code that is made freely available for possible modification and redistribution. Products include permission to use and view the source code, design documents, or content of the product. The open source model is a decentrali ...
project developed by
Google Google LLC (, ) is an American multinational corporation and technology company focusing on online advertising, search engine technology, cloud computing, computer software, quantum computing, e-commerce, consumer electronics, and artificial ...
. Games such as '' Quake'', '' XaoS'', '' Battle for Wesnoth'', ''
Doom Doom is another name for damnation. Doom may also refer to: People * Doom (professional wrestling), the tag team of Ron Simmons and Butch Reed * Daniel Doom (1934–2020), Belgian cyclist * Debbie Doom (born 1963), American softball pitche ...
'', '' Lara Croft and the Guardian of Light'', '' From Dust'', and
MAME MAME (formerly an acronym of Multiple Arcade Machine Emulator) is a free and open-source emulator designed to emulate the hardware of arcade games, video game consoles, old computers and other systems in software on modern personal computers and ...
, as well as the sound processing system
Csound Csound is a domain-specific computer programming language for audio programming. It is named Csound because it is written in the language C, in contrast to some of its predecessors. It is free and open-source software, released under the GNU Les ...
, have been ported to Native Client. Native Client has been available in the
Google Chrome Google Chrome is a web browser developed by Google. It was first released in 2008 for Microsoft Windows, built with free software components from Apple WebKit and Mozilla Firefox. Versions were later released for Linux, macOS, iOS, iPadOS, an ...
web browser since version 14, and has been enabled by default since version 31, when the Portable Native Client (PNaCl, pronounced: pinnacle) was released. Native Client has also been used to safely run downloaded code in software other than web browsers, like in the Dæmon game engine. 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 ...
implementation was released in March 2010.
x86-64 x86-64 (also known as x64, x86_64, AMD64, and Intel 64) is a 64-bit extension of the x86 instruction set architecture, instruction set. It was announced in 1999 and first available in the AMD Opteron family in 2003. It introduces two new ope ...
,
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 i386, 80386 microprocessor in 1985. IA-32 is the first incarn ...
, and MIPS were also supported. To run an application portably under PNaCl, it must be compiled to an architecture-agnostic and stable subset of the
LLVM LLVM, also called LLVM Core, is a target-independent optimizer and code generator. It can be used to develop a Compiler#Front end, frontend for any programming language and a Compiler#Back end, backend for any instruction set architecture. LLVM i ...
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 (normal ...
. 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 (: elves) is a type of humanoid supernatural being in Germanic peoples, Germanic folklore. Elves appear especially in Norse mythology, North Germanic mythology, being mentioned in the Icelandic ''Poetic Edda'' and the ''Prose Edda'' ...
. 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 (technology), fault has occurred, and pinpointing the type of fault and its location. Two ...
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 The GNU toolchain is a broad collection of programming tools produced by the GNU Project. These tools form a toolchain (a suite of tools used in a serial manner) used for developing software applications and operating systems. The GNU toolchain pl ...
, specifically
GNU Compiler Collection The GNU Compiler Collection (GCC) is a collection of compilers from the GNU Project that support various programming languages, Computer architecture, hardware architectures, and operating systems. The Free Software Foundation (FSF) distributes ...
(GCC),
GNU Binutils The GNU Binary Utilities, or , is a collection of programming tools maintained by the GNU Project for working with executable code including assembly, linking and many other development operations. The tools are originally from Cygnus Solut ...
, and
LLVM LLVM, also called LLVM Core, is a target-independent optimizer and code generator. It can be used to develop a Compiler#Front end, frontend for any programming language and a Compiler#Back end, backend for any instruction set architecture. LLVM i ...
. Native Client is licensed under a BSD-style license. 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 ...
as its
C library The C standard library, sometimes referred to as 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 origina ...
, but a port of
GNU C Library The GNU C Library, commonly known as glibc, is the GNU Project implementation of the C standard library. It provides a wrapper around the system calls of the Linux kernel and other kernels for application use. Despite its name, it now also dir ...
(GNU libc) is also available.


Pepper

NaCl denotes
sodium chloride Sodium chloride , commonly known as Salt#Edible salt, edible salt, is an ionic compound with the chemical formula NaCl, representing a 1:1 ratio of sodium and chloride ions. It is transparent or translucent, brittle, hygroscopic, and occurs a ...
, common table
salt In common usage, salt is a mineral composed primarily of sodium chloride (NaCl). When used in food, especially in granulated form, it is more formally called table salt. In the form of a natural crystalline mineral, salt is also known as r ...
; as a
pun A pun, also known as a paronomasia in the context of linguistics, 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 t ...
, the name of
pepper Pepper(s) may refer to: Food and spice * Piperaceae or the pepper family, a large family of flowering plants ** Black pepper ** Long pepper ** Kampot pepper * ''Capsicum'' or pepper, a genus of flowering plants in the nightshade family Solanacea ...
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) is a deprecated application programming interface (API) for web browser plugins, initially developed for Netscape Navigator 2.0 in 1995 and subsequently adopted by other browsers. In the ...
, then rewritten from scratch. It was used in Chromium and
Google Chrome Google Chrome is a web browser developed by Google. It was first released in 2008 for Microsoft Windows, built with free software components from Apple WebKit and Mozilla Firefox. Versions were later released for Linux, macOS, iOS, iPadOS, an ...
to enable the PPAPI version of
Adobe Flash Adobe Flash (formerly Macromedia Flash and FutureSplash) is a mostly discontinuedAlthough it is discontinued by Adobe Inc., for the Chinese market it is developed by Zhongcheng and for the international enterprise market it is developed by Ha ...
and the built-in
PDF Portable document format (PDF), standardized as ISO 32000, is a file format developed by Adobe Inc., Adobe in 1992 to present documents, including text formatting and images, in a manner independent of application software, computer hardware, ...
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 s ...
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 Some common additions to the standar ...
s (version 19) and
WebSocket WebSocket is a computer communications protocol, providing a full-duplex, simultaneous two-way communication channel over a single Transmission Control Protocol (TCP) connection. The WebSocket protocol was standardized by the Internet Engineering ...
s (version 18). , Google's open source browser,
Chromium Chromium is a chemical element; it has Symbol (chemistry), symbol Cr and atomic number 24. It is the first element in Group 6 element, group 6. It is a steely-grey, Luster (mineralogy), lustrous, hard, and brittle transition metal. 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 curr ...
developers stated in 2014 that they would not support Pepper, as there were no full specification of the API beyond its implementation in Chrome, which itself was designed for use with Blink layout engine only, and had private APIs specific to the Flash Player plugin which were 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. In July 2017, Adobe deprecated Flash and announced its end-of-life in the end of 2020. By January 2021, Adobe Flash Player, Google Chrome, Firefox, Safari, and Windows received updates disabling or entirely removing Flash.


Applications

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


Usage outside of web browsers

The
open-source Open source is source code that is made freely available for possible modification and redistribution. Products include permission to use and view the source code, design documents, or content of the product. The open source model is a decentrali ...
Unvanquished game makes use of Native Client in the Dæmon game engine in replacement of the Q3VM (
Quake III ''Quake III Arena'' is a 1999 first-person shooter game developed by id Software. The third installment of the ''Quake'' series, ''Arena'' differs from previous games by excluding a story-based single-player mode and focusing primarily on mult ...
virtual machine In computing, a virtual machine (VM) is the virtualization or emulator, emulation of a computer system. Virtual machines are based on computer architectures and provide the functionality of a physical computer. Their implementations may involve ...
). In such game engine, the Native Client sandbox is used to safely run arbitrary game code ( mods) downloaded from game servers. Using the Native Client technology makes possible for
gameplay Gameplay is the specific way in which players interact with a game. The term applies to both video games and Tabletop game, tabletop games. Gameplay is the connection between the player and the game, the player's overcoming of challenges, and t ...
developers to use the C++ language for games running in the virtual machine, to use C++ libraries, to share code between the game and the engine and to get better performance than with the Q3VM.


Reception

Some groups of browser developers supported the Native Client technology while others did 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 (besides
JavaScript JavaScript (), often abbreviated as JS, is a programming language and core technology of the World Wide Web, alongside HTML and CSS. Ninety-nine percent of websites use JavaScript on the client side for webpage behavior. Web browsers have ...
).
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 competiti ...
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 were more critical of this sandboxing technology as it had substantial or substantive interoperability issues.
Mozilla Mozilla is a free software community founded in 1998 by members of Netscape. The Mozilla community uses, develops, publishes and supports Mozilla products, thereby promoting free software and open standards. The community is supported institution ...
's vice president of products, Jay Sullivan, 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 (born 1973) 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 Chi ...
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 W ...
technology, plagued with DLL Hell.
Håkon Wium Lie Håkon Wium Lie (born July 26, 1965) is a Norwegian web pioneer, a standards activist, and the chairman of YesLogic, developers of Prince CSS-based PDF rendering software. He is best known for developing Cascading Style Sheets (CSS) while work ...
, Opera's CTO, believed 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
sandbox A sandbox is a sandpit, a wide, shallow playground construction to hold sand, often made of wood or plastic. Sandbox or sand box may also refer to: Arts, entertainment, and media * Sandbox (band), a Canadian rock music group * Sandbox (Gu ...
ing developed in Google is gVisor. It is intended to replace NaCl in
Google Cloud Google Cloud Platform (GCP) is a suite of cloud computing services offered by Google that provides a series of modular cloud services including computing, data storage, data analytics, and machine learning, alongside a set of management tools ...
, to be more exact in
Google App Engine Google App Engine (also referred to as GAE or App Engine) is a cloud computing platform used as a service for developing and hosting web applications. Applications are sandboxed and run across multiple Google-managed servers. GAE supports aut ...
. Google has also been promoting
WebAssembly WebAssembly (Wasm) defines a portable binary-code format and a corresponding text format for executable programs as well as software interfaces for facilitating communication between such programs and their host environment. The main goal of ...
.


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 Emscripten is an LLVM/Clang-based compiler that compiles C and C++ source code to WebAssembly, primarily for execution in web browsers. Emscripten allows applications and libraries written in C or C++ to be compiled ahead of time and run effi ...
* Sandboxie, running Windows programs in a sandbox *
WebAssembly WebAssembly (Wasm) defines a portable binary-code format and a corresponding text format for executable programs as well as software interfaces for facilitating communication between such programs and their host environment. The main goal of ...
, a bytecode standard for web browsers *
XAML Browser Applications XAML Browser Applications (XBAP, pronounced "ex-bap") are Windows Presentation Foundation (.xbap) applications that were intended to run inside a web browser such as Firefox or Internet Explorer through the NPAPI interface. Due to NPAPI being p ...
(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. The name "I/O" is taken from the number googol, with the "I" representing the first digit "1" in a googol and the "O" representing the s ...
2009
A list of OSS projects ported to Native ClientNative Client source code in GitGame engine-focused introduction to Native Client with a comparison between the Quake3 Virtual Machine and PNaCL
br/>


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 DOSBox is a free and open-source MS-DOS emulator. It supports running programs primarily video games that are otherwise inaccessible since hardware for running a compatible disk operating system (DOS) is obsolete and generally unavailab ...
to Native Client (PNaCl)
SodaSynth
a synthesizer for Native Client (not PNaCl)
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 Software using the BSD license
Native Client Google Native Client (NaCl) is a discontinued sandboxing technology for running either a subset of Intel x86, ARM, or MIPS native code, or a portable executable, in a sandbox. It allows safely running native code from a web browser, indepen ...
Cross-platform free software