BT

New Early adopter or innovator? InfoQ has been working on some new features for you. Learn more

WebKit Now Has Full Support for WebAssembly

| by Abel Avram Follow 3 Followers on Jun 10, 2017. Estimated reading time: 1 minute |

Apple Safari has full support for WebAssembly including preparation for future integration with ECMAScript Modules and threads.

Apple has added full support for WebAssembly to WebKit, enhancing the Safari browser to be able to run code written in other languages. WebKit supports WebAssembly on  x86, x64 and ARM 64 platforms.

Since WebAssembly is accessible in the browser as a JavaScript object, WebKit is reusing existing JavaScript functionality to make it work. For example, the WebAssembly.Instance API is implemented using the ECMAScript modules already supported by the browser, preparing the way for integration with JavaScript modules when it becomes a requested feature. Also, WebKit’s implementation of WebAssembly is thread safe preparing it for when it will add support for threads, a feature that Chrome has on the roadmap too.

When a tool compiles some code to WebAssembly, it can already include various performance optimizations. But WebKit adds two more tiers of optimizations, Build Bytecode Quickly (BBQ) and the Optimized Machine-code Generator (OMG), both based on B3 JIT used by WebKit to tune up JavaScript code. BBQ is four times faster than OMG, but the resulted code is twice as slower, according to Apple engineers. BBQ is used to run code quickly, while OMG is used for hot code, performing deeper optimizations for sections of the code where speed is important.

WebAssembly is available in Safari Technology Preview Release 32. Chrome and Firefox have added full support for WebAssembly in March, while Microsoft Edge has it in preview mode for all their platforms: desktop, mobile, Xbox, and mixed reality.

Rate this Article

Adoption Stage
Style

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Tell us what you think

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread
Community comments

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Discuss

Login to InfoQ to interact with what matters most to you.


Recover your password...

Follow

Follow your favorite topics and editors

Quick overview of most important highlights in the industry and on the site.

Like

More signal, less noise

Build your own feed by choosing topics you want to read about and editors you want to hear from.

Notifications

Stay up-to-date

Set up your notifications and don't miss out on content that matters to you

BT