This week marks a very important announcement for Chromium, the open source counterpart to Google’s Chrome web browser. Starting with Chrome 31, Google has enabled the Portable Native Client (PNaCl, pronounced ‘pinnacle’) by default. This provides developers a way to bring native performance to HTML5 applications while still keeping applications portable AND secure.
PNaCl allows HTML5 applications to unleash the power of the CPU, GPU and video hardware. Developers compile their code once and then run it on any hardware platform or embed their PNaCl application in any website. PNaCl offers HTML5 apps native-level performance across all three supported CPU architectures, including MIPS.
What is PNaCl?
Portable Native Client is a hardware architecture-independent version of Native Client. Traditionally, C/C++ development used a “compile → link” workflow that produced a platform- and architecture-dependent executable. This workflow meant that developers had to create a different version of the same app for each ISA they were targeting (x86, ARM, MIPS). PNaCl simplifies development because it uses an LLVM-type compiler infrastructure with a “compile → link → translate” workflow. This splits the workflow into a front-end and a back-end; the front-end produces an intermediary representation in the form of a “linked” binary; the binary is then translated by each device’s back-end according to its specific system architecture.
The left side of the diagram shows how to use PNaCl (via Google)
PNaCl provides a clear path towards complete platform independence while maintaining the superior performance levels of NaCl. With PNaCl, fast and feature-rich 3D gaming, computationally-intensive image and video processing/playback, or multimedia and digital creation apps like Adobe Photoshop can run on any device inside Chrome. Moreover, because translation is done at the device level, developers don’t have to worry about translating for new architectures, or making any hardware-specific optimizations; instead, features become automatically available without the need to rebuild applications.
Thanks to PNaCl, code portability has finally arrived
When accessing one of these apps, its code runs in a sandbox that isolates it from the surrounding system, providing a faster (and more reliable) way of executing code than recompiling the app from source.
Those who want to get a glimpse of PNaCl can download the latest version of Chrome and launch some of the demos that Google has already provided. Developers have already started taking advantage of some of the features in NaCl already; Bastion from indie game studio Supergiant Games was one of the first games that could be played through the Chrome web browser.
An example of the Bullet Physics SDK ported to Native Client, using WebGL for rendering
This demo renders the Voronoi diagram for a moving set of points using a brute force technique
Google has also enabled an app launcher environment which allows a user to run web apps outside of the browser and directly from the desktop. This is just a glimpse of the future of HTML5 beyond the boundaries of a web browser.
But the good news doesn’t stop there: Android 4.4 ‘KitKat’, including the new Chrome-based WebView and the new Android Run Time (ART), is already up and running on MIPS CPUs, thanks to full Google native support for MIPS in Android.
We will be demoing some of these technologies next week at the Embedded Technology 2013 conference in Japan so make sure you stop by our booth to learn more about Chromium for MIPS, Android and other more recent developments in the Imagination ecosystem. Remember to follow us on Twitter (@ImaginationPR and @MIPSGuru) for the latest news and announcements.