WebAssembly and PlayCanvas?

http://webassembly.org/

Seeing as WebAssembly is gaining more traction, and seems to be packaged more thoroughly with Chrome 60 which just came out, how can this ultimately affect the optimization of web apps like PlayCanvas?

I know very little, and I was curious your thoughts on the matter.

I know that as it stands, there is a huge potential to take languages like c/c++ and game engines like Unity and Unreal to allow amazing 3d platforms on the web! But I have messed with both these game engines and love them both for different reasons, but I think PlayCanvas as a game engine is far superior when it comes to interface and use-ability. Was curious if there were any steps to advance the platform to be the premier tool for web game/app dev.

PlayCanvas has always been built with the web in mind - essentially, it’s a ‘web-first’ game engine. WebAssembly is a mechanism to get non-web codebases (C/C++) translated to JS so that they are runnable in a browser. But just because something is runnable in a browser, doesn’t mean it’s without problems.

As things stand today, WebAssembly has some issues:

  • App size still comes out larger than the equivalent hand-written JS codebase. If you care about download speed/time, this matters.
  • WebAssembly isn’t easy to debug. In fact, I’m not sure how you debug it at all. With a JS codebase, you can step through it and debug trivially in the browser dev tools.
  • Building the codebase is a pain. Right now, we can edit engine code and hit F5 to reload. With WASM, you have to recompile and reload. Iteration times are longer.
  • Coding directly to WebGL means we drive the API exactly as we want to. WASM translates OpenGL ES calls to WebGL. It’s not a 1-to-1 mapping.

Also:

  • We can do cool dynamic stuff with code in JS.
  • We’re not constrained by a fixed heap size.

And lastly: we can architect an engine that truly belongs on the web rather than porting a native experience. In our experience, the expectations of a web end-user differ from a native app end-user.

Another way to look at this: what would leveraging WASM actually buy us? Better performance? We have no data on that but we’ll keep an eye on developments there. Beyond that, you’re just going to end up with more rigid, larger apps. And we think that’s a bad thing.

So for now, we’ll keep tabs on WASM but we don’t have any intention to use it. PlayCanvas is more than fine using vanilla JS.

1 Like

I agree actually with your assertions. Thanks for the well thought through response!

I mean I love your platform and really so no immediate need to deviate! I plan to do some experiments with Unity in the future, but the potential in playcanvas is so great!

Thanks again :slight_smile: