Paul Krill
Editor at Large

Apple’s WebKit joins the WebAssembly bandwagon

news
Jun 7, 20172 mins

Google, Microsoft, and Mozilla already support the performance-boostig technology in their browser engines

Momentum continues to build for the WebAssembly binary format. WebKit, Apple’s open source browser engine used in Safari, now has a full implementation of WebAssembly.

The implementation supports WebAssembly on Intel x86-64 and ARM64 processors. Calling WebAsembly a “no-nonsense sidekick to JavaScript,” Apple’s Saam Barati and two colleagues, JF Bastien and Keith Miller, described WebAssembly as a low-level binary format designed to be a suitable compilation target for languages such as C++. “The WebAssembly code that the browser sees will already have undergone high-level, language-specific optimizations. This is great because it means implementations don’t have to know about how C++ or other languages are optimized,” Barati said.

With WebAssembly, the hope is that it will boost web application speeds and enable languages other than JavaScript to run in browsers. The technology also has the support of the other three major browser vendors: Google, Microsoft, and Mozilla.

But WebAssembly cannot do everything JavaScript does. It cannot, for example, access the DOM without calling into JavaScript, so it is meant to be used with JavaScript. Because WebAssembly exposes itself as a regular JavaScript object, its WebKit implementation can reuse some machinery already in WebKit, including an ECMAScript module used to implement WebAssembly. To allow sharing of modules between web workers and prepare for features such as threads, Apple’s internal representation of WebAssembly code has been made thread-safe.

Apple’s WebKit implementation of WebAssembly follows Google’s recent decision to opt for WebAssembly for running native code in the browser; as a result, Google dumped its own Portable Native Client (PNaCl) technology. The four browser makers previously had agreed on a design of the initial WebAssembly and binary format. As a result, browsers now can have WebAssembly on by default.

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