WebAssembly wins! Google pulls plug on PNaCl

Citing the need for cross-browser compatibility, Google chooses WebAssembly for running native code in Chrome

For Google, it is time to ring out the old and ring in the new when it comes to running native code in the browser. To this end, Google is making the WebAssembly portable code format its solution for native code going forward, displacing the company’s Portable Native Client (PNaCl).

PNaCl lacked the desired cross-browser compatibility offered by WebAssembly, the company said. PNaCl support will be removed early next year except in Chrome Apps and Extensions. Google said usage of PNACl is low enough to warrant deprecation and that WebAssembly has a vibrant ecosystem, making it a better fit. “Historically, running native code on the web required a browser plugin. In 2013, we introduced the PNaCl sandbox to provide a means of building safe, portable, high-performance apps without plugins,” Google’s Brad Nelson, software engineer on NaCl, PNaCl, and WebAssembly, said. “Although this worked well in Chrome, it did not provide a solution that worked seamlessly across all browsers.”

The switch represents more momentum for WebAssembly, a cross-browser format that has the potential to improve the performance of web applications and enable other languages beyond JavaScript in browsers. All major browser vendors—Apple, Google, Microsoft, and Mozilla—have participated in its development. Cross-browser consensus has been reached on an initial version of WebAssembly, including the API and binary format. “Applications using WebAssembly already run in multiple browsers: Chrome and Firefox support WebAssembly natively and Edge and Safari support WebAssembly in preview versions of their browsers,” Nelson said.

PNaCl compiles C and C++ code to a subset of JavaScript called asm.js. Google is offering recommendations for migrating PNaCl to WebAssembly, advice that includes using the Emscripten compiler from the PNaCl SDK for most use cases. API migrations also are advised. Google has offered a roadmap for WebAssembly support, with a SharedArrayBuffer capability due in August that sets the stage for interoperable WebAssembly threads. A WebAssembly True-Async capability, also due in August, will allow for background WebAssembly compilation. WebAssembly Content Security Policy support is planned for Chrome in September. 

Join the Computerworld newsletter!

Error: Please check your email address.

More about AppleContent SecurityGoogleMicrosoftMozilla

Show Comments