WebAssembly

Justin Wernick <>
Curly Tail, Curly Braces
2018-08-21

Abstract

In this article, I explore the opportunity that WebAssembly brings to bridge the gap between native desktop applications and web applications.

Acknowledgements

This article was originally published on OfferZen. A huge thank you to Anne Gonschorek for her help in putting this article together.

WebAssembly

While there are many benefits to web applications, they aren't always the best option. What if you want all the perks of a desktop app, but also want to make it easy to use and share? Here's a quick introduction to WebAssembly and why it's so useful.

Recently, more and more everyday tools have been created as web applications. Even if you choose to download the desktop version of an application like Slack, you get a web application that has been bundled with a browser. For performance, this isn’t really great: it’s good enough for most cases but they are hogging more system resources than they should.

That’s why native desktop applications do still have a place, especially for applications where you:

At the same time, you don’t want everything to be a native desktop application. There are good reasons that things are moving towards the web, especially in the context of games:

The web as a platform also makes it much easier to share content. There are many games that run in web browsers. They're one of the easiest types of games to share, since I can drop a link into an article like this, and just by clicking the link, you could be playing with my pomeranian to let my pug take a nap!

So what is WebAssembly and why is it cool?

WebAssembly is a compile target for running native code embedded in a web browser - essentially an assembly language but for the web. This:

Be aware:

  1. You can’t just run your code through a compiler and have it produce WebAssembly that magically works. You might have to make some architectural changes to fit your application into the web browser ecosystem.

  2. You won't be able to just write an infinite game loop like you would on desktop, you need to rely on callbacks into your WebAssembly code from the web browser.

  3. You also may need to handle different performance characteristics between web and native, like assets being on the other side of a network rather than on the local hard drive.

Important things to know about WebAssembly

Resources

If you want to hear more about this from me, you can:


If you'd like to share this article on social media, please use this link: https://www.worthe-it.co.za/blog/2018-08-21-webgame-webassembly.html

Tag: blog


Related Articles

Game Programming Inspires My Software Development

I've been fascinated by computer games for as long as I can remember. In fact, almost all of my early computer knowledge came about because I wanted to play games. A lot of time has passed since then and I now work as a software engineer, and most of the systems I work on don't look much like games. Throughout my career, I've maintained an interest in what game engineers are doing. This article presents a few concepts from the context of computer games that help me to solve the problems that I do face.

Rusty Microphone

In this article, I show off a program that I wrote to give myself real time feedback on my intonation while playing the trumpet.