Wasm hybrid application hello world anyone?

#1

The great thing about modern HTML5 + Wasm (or Asm.js) is that it is the first UI technology that works effectively everywhere, which means:

  • Web, of course, including as offline app,
  • Desktop, via electron (or servo or sciter or something)
  • Mobile, via cordova

And applications that work in all three ways are certainly being written. E.g. several instant messaging applications are made that way. But using other languages. And I would like to use Rust.

So what I would like to see is an example application that:

  • Uses Rust, with suitable framework (yew comes to mind) to show simple UI.
  • Comes with build scripts to pack it for web, with electron and with cordova (probably using wasm-pack somewhere in the process).

I would also like to see build script for Travis and one completely dockerised (as the corresponding Dockerfile serves as testable documentation of the development environment).

Is there anything like that? Is anybody working on anything like that?

If not, I’ll likely give it a shot.

1 Like
#2

I am learning Rust and Wasm.
I prepared a simple memory game project to see how it works on the web, with electron and with cordova.
All the projects start with the name “mem1”:

Sadly the cordova app is not working on android. But it works in the browser on win10 when using the development server of PhoneGap.
I didn’t try it yet on iOS.
I am working on it, but the infoation are scarce.

#3

I found the problem and solved it.
The wasm file is opened in javascript in an ajax call.
Modern browsers don’t alow ajax on local files.
PhoneGap app works with local files.
I changed the location of the wasm file to an URL on github and now it works.