Evolving the Web Platform, for Real This Time

web20-illustrated (1)

Many companies have been trying to evolve the web as a platform over the last 15 years. From Macromedia with Flash to Microsoft with Silverlight, these attempts have done their best to allow enhanced applications to be written for the web. Most developers I know say they’ve failed. Luckily there’s a new light at the end of the tunnel, one that has more hope than ever before, and it’s called Web Assembly

What makes this different than the others?

Well, first and foremost it’s being worked on by all the big browser makers. Teams from Google, Microsoft, Apple, and Mozilla are all on board, which is huge. It’s also tied in closely with the programming language of the Web, JavaScript.

What do you mean, the web as a “platform”?

Companies like Google have been doing everything they can for the last 10 years to convince developers that the Web is the best place or “platform” to build applications. Developers can choose to build apps on the Windows platform, OS X platform (to run on a Mac), or they can write them for the Web platform.

However, one of the biggest issues with this is that certain applications (like gaming) require a lot of processing power. A developer who wants to write cutting edge games is going to get more performance writing for Windows or OS X, commonly referred to as writing a “native” app. With the WebAssembly language, the performance of Web platform games may get a lot closer to Native.

web Evolving the Web Platform, for Real This Time

But how does it work?

WebAssembly will allow developers to write faster applications in the same way Ruby and Python language developers currently do. Both are beautiful programming languages, but their applications are almost always slower than compiled languages like C. Let’s say, for example, you’re a Ruby developer building an app that takes an image and outputs that image into multiple sizes, and you want to do this really fast. You’d likely find a library written in C that you could call from your Ruby code for the resizing, and you’d get a nice speed boost. Now let’s say that you’re a JavaScript developer building an app in the browser that does the same thing. If you wanted to do the image resizing in someone’s browser using JavaScript, you could but it might be painfully slow. There’s no way to speed it up other than to move the processing back onto the server side, out of the browser and perhaps using an aforementioned method with Ruby or Python.

With WebAssembly, this scenario is about to change. Thanks to the new language, in the future you’ll be able to take that existing C image processing library, compile it into WebAssembly code, retain much of its speed and efficiency and then ship that code along with your JavaScript into someone’s browser. Just like Ruby called C to perform faster, JavaScript will call your WebAssembly library to perform faster – all within a browser. Once WebAssembly becomes ubiquitous, it is likely there will be many open source WebAssembly libraries that JavaScript developers can include and send to someone’s browser to create faster Web pages. Along with the previous example of image processing, WebAssembly could also speed up things like games, music and video applications, virtual reality applications, simulations, visualizations and so on.

real Evolving the Web Platform, for Real This Time

A real world application

Another way to understand the potential impact of WebAssembly is through an existing application like video editing. Currently, to effectively edit a video you have to download a native (Mac OS X or Windows) application. A video editing application in the browser would be much slower because of the limitations of JavaScript. With WebAssembly, the browser performance of a video editing application will get a major speed boost. Will it rival the speed of native? There’s no way to be sure yet, but it’s definitely going to get a whole lot closer.

It’s important to note that WebAssembly does not and will not replace JavaScript. In fact, I’d argue that it’s more critical than ever for aspiring and experienced developers to continue to hone their JavaScript skills (and this is why we recently launched JavaScript.com as a resource to the developer community).

Because WebAssembly is a low-level language that isn’t ideal for coding, most developers will still be writing JavaScript for their Web applications as usual. Then to optimize small parts of their app, they will call out to open source WebAssembly libraries.

Paired strategically with JavaScript, WebAssembly could truly evolve the Web as an application platform. It will be exciting to see how things unfold.

Leave a Reply