Apple’s WebKit joins the WebAssembly bandwagon

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.

Join the Computerworld newsletter!

Error: Please check your email address.

More about AppleGoogleIntelMicrosoftMozilla

Show Comments

Market Place