asm.js is headed to the Chakra JavaScript engine for Spartan in Windows 10, and what it means for games

Not the official Spartan Browser logo.

Not the official Spartan Browser logo.

Earlier today, we flipped asm.js to “In Development” at status.modern.ie. Support for asm.js has beenone of the top 10 most-requested items at the IE Suggestion Box on UserVoice since we launched it in December.

This is huge.

What is asm.js?

John Resig talked about it more in depth in his blog, some time ago.

Here’s how he described it:

Asm.js comes from a new category of JavaScript application: C/C++ applications that’ve been compiled into JavaScript. It’s a whole new genre of JavaScript application that’s been spawned by Mozilla’s Emscripten project.

Emscripten takes in C/C++ code, passes it through LLVM, and converts the LLVM-generated bytecode into JavaScript (specifically, Asm.js, a subset of JavaScript).

What does it mean for me as a gamer / developer?

Around the same time frame that Unity had their annual UNITE conference in Seattle, the company announced WebGL support. This would require asm.js, which was previously only working in Mozilla’s Firefox browser.

From the Unity blog:

As mentioned above, to run in WebGL, all our code needs to be JavaScript. We use the emscripten compiler toolchain to cross-compile the Unity runtime code (written in C and C++) into asm.js JavaScript. asm.js is a very optimizable subset of JavaScript which allows JavaScript engines to AOT-compile asm.js code into very performant native code (see here for a better explanation).

 

asm.js compilation and execution pipeline

 

Unity isn’t the only engine on board with asm.js and WebGL. Epic Games has been focusing on this for the past several years as well, and you can compile your Unreal Engine 4 projects to HTML5 right now, by following these steps.

Epic even has a strategy game demo working in Unreal Engine 4 right now.

Here’s what they’ve been working on lately, though:

 

“Using asm.js we were able to get Monster Madness up and running in a day, and have been extremely happy with how the Web has expanded our customer base, so much so that we’re now planning to expand the technology to our full games portfolio,” said Jeremy Stieglitz, CTO at NomNom Games.

“It has also been extremely simple to market our games with just a Web link leveraging channels like social media and to get players into the game straight away with just the click of a mouse.”

The response from others

Mozilla had some nice things to say as well.

This is a strong vote of confidence by Microsoft in asm.js and the overall compile-to-web story. With all the excitement and momentum we’ve seen behind Emscripten and asm.js before this announcement, I can’t wait to see what happens next.

I look forward to collaborating with Microsoft and other browser vendors on taking asm.js to new levels of predictable, near-native performance.

-----------------------


subscribe-to-youtube

Leave a Reply