Feeds

Google's Native Code browser tech goes cross-platform

Write web modules in C/C++ that run on both Intel and ARM

Choosing a cloud hosting partner with confidence

Google I/O At its annual I/O conference in San Francisco this week, Google unveiled a new version of its Native Client technology that allows developers to deploy binary code for web applications in an architecture-independent way.

With the original version of Native Client (NaCl), developers could write modules in C or C++ and compile them into binary packages to be executed inside the browser at near-native speed. The initial release only supported 32-bit and 64-bit Intel x86 architectures, but Google added support for ARM in January.

The revamped version of the tech, dubbed Portable Native Client – PNaCl for short, pronounced "pinnacle" – still allows developers to target all three architectures, but now they can do so with a single executable package instead of compiling a separate package for each processor type.

It works by essentially breaking the process of compiling PNaCl modules into two steps. The PNaCl toolchain really only compiles the C/C++ code halfway, outputting LLVM compiler bitcode instead of native machine code. That bitcode is then packaged into a .pexe file for deployment.

The client browser handles the last mile itself, translating the bitcode of any .pexes it receives into whichever machine code format is appropriate for the platform on which it's running. That extra compilation step does add a bit of startup overhead, but not too much, and Google has been working to speed up the process even more.

PNaCl does have a few limitations, however. Unlike the earlier NaCl technology, PNaCl does not support linking with glibc, the standard C library found on many Unix-like systems. Instead, developers must statically link their PNaCl modules with the more lightweight Newlib library.

The new version of PNaCl, released on Wednesday, also introduces a new format for .pexe files. Modules created with older, experimental versions of the PNaCl toolchain will no longer work in browsers that support the latest version of the PNaCl spec.

That support is limited to Chrome version 29 or higher – which, for the time being at least, means only the bleeding-edge "Canary" releases of the browser. Fortunately, you can install Canary side-by-side with more stable versions of Chrome, so you're not forced to use it all the time.

Note, also, that PNaCl only works with Chrome running on Windows, OS X, Linux, and Chrome OS. Although it does support the ARM architecture, there is still no support for NaCl or PNaCl in Chrome for Android, so deploying binary modules for Android smartphones and tablets is out.

And the biggest catch of all, of course, is that Chrome is currently the only browser to support NaCl in any form, and it looks like it's going to stay that way.

For a while, it seemed as though the open source Firefox browser might be a likely candidate to adopt Google's tech, but the Mozilla Foundation has since come out strongly against the native-code approach, preferring to work on accelerating JavaScript execution through projects like asm.js.

That means web apps written using PNaCl will only run on Chrome, probably forever. But that's not all bad – as Google's Sundar Pichai observed in his Google I/O keynote, Chrome is the most popular browser in the world, after all.

And like the original NaCl, PNaCl is uniquely useful for organizations who want to use existing C/C++ code in web apps without translating their algorithms into another language, such as JavaScript. Few other tools let you do that as easily, which could make PNaCl's browser limitation a fair tradeoff, in some cases.

For more technical information on PNaCl and its architecture, you can consult Google's technical paper on the system. Or, if you want to just dive in and try the tools, you can find instructions and downloads at the PNaCl project's homepage. ®

Secure remote control for conventional and virtual desktops

More from The Register

next story
ONE MILLION people already running Windows 10
A third of them are doing it in VMs, but early feedback focuses on frippery
Sign off my IT project or I’ll PHONE your MUM
Honestly, it’s a piece of piss
Netscape Navigator - the browser that started it all - turns 20
It was 20 years ago today, Marc Andreeesen taught the band to play
Sway: Microsoft's new Office app doesn't have an Undo function
Content aggregation, meet the workplace ... oh
Do Moan! MONSTER 6-day EMAIL OUTAGE hits Domain Monster
Customers freaked out by frightful service
Ploppr: The #VultureTRENDING App of the Now
This organic crowd sourced viro- social fertiliser just got REAL
Return of the Jedi – Apache reclaims web server crown
.london, .hamburg and .公司 - that's .com in Chinese - storm the web server charts
NetWare sales revive in China thanks to that man Snowden
If it ain't Microsoft, it's in fashion behind the Great Firewall
prev story

Whitepapers

Forging a new future with identity relationship management
Learn about ForgeRock's next generation IRM platform and how it is designed to empower CEOS's and enterprises to engage with consumers.
Win a year’s supply of chocolate
There is no techie angle to this competition so we're not going to pretend there is, but everyone loves chocolate so who cares.
Why cloud backup?
Combining the latest advancements in disk-based backup with secure, integrated, cloud technologies offer organizations fast and assured recovery of their critical enterprise data.
High Performance for All
While HPC is not new, it has traditionally been seen as a specialist area – is it now geared up to meet more mainstream requirements?
Saudi Petroleum chooses Tegile storage solution
A storage solution that addresses company growth and performance for business-critical applications of caseware archive and search along with other key operational systems.