Native Client (NaCl) brings the performance and low-level control of native code to modern web browsers, without sacrificing the security benefits and portability of web applications. By helping developers directly leverage the power of the underlying CPU and GPU, NaCl enables web applications from
photo editing and
audio mixing, to
3D gaming and
CAD modeling. Today, we’re launching
Portable Native Client (PNaCl, pronounced pinnacle), which lets developers compile their code once to run on any hardware platform and embed their PNaCl application in any website.
Under the hood, PNaCl works by compiling native C and C++ code to an intermediate representation, rather than architecture-specific representations as in Native Client. The
LLVM-style bytecode is wrapped into a portable executable, which can be hosted on a web server like any other website asset. When the site is accessed, Chrome fetches and translates the portable executable into an architecture-specific machine code optimized directly for the underlying device. This translation approach means developers don’t need to recompile their applications multiple times to run across x86, ARM or MIPS devices.
PNaCl unlocks the power of native performance for applications like
Bullet physics simulators and
Lua interpreters. For now PNaCl is Chrome only, but developers can make their PNaCl applications compatible with other browsers via
pepper.js, which allows applications to use the
Pepper API from JavaScript.
Portable Native Client provides a natively fast, secure option to meet the demands of a new generation of web applications. As always, we look forward to your questions and feedback on
Stack Overflow or our
discussion forum, and will host a
Google Developers Live event on Thursday, November 14th to answer your
questions. Visit
gonacl.com for tutorials, documentation, and to get the SDK.
Posted by David Sehr, Summiting Engineer and Mountain Man