Paul Krill
Editor at Large

WebAssembly wins! Google pulls plug on PNaCl

news
Jun 2, 20172 mins

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

snail rocket fast speed
Credit: Thinkstock

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. 

Paul Krill

Paul Krill is editor at large at InfoWorld. Paul has been covering computer technology as a news and feature reporter for more than 35 years, including 30 years at InfoWorld. He has specialized in coverage of software development tools and technologies since the 1990s, and he continues to lead InfoWorld’s news coverage of software development platforms including Java and .NET and programming languages including JavaScript, TypeScript, PHP, Python, Ruby, Rust, and Go. Long trusted as a reporter who prioritizes accuracy, integrity, and the best interests of readers, Paul is sought out by technology companies and industry organizations who want to reach InfoWorld’s audience of software developers and other information technology professionals. Paul has won a “Best Technology News Coverage” award from IDG.

More from this author