What is WebAssembly (wasm) ?
Why, How and What of WebAssembly.
WebAssembly is a new type of code that can be run in modern web browsers — it is a low-level assembly-like language with a compact binary format that runs with near-native performance and provides languages such as C/C++, C# and Rust with a compilation target so that they can run on the web.
Now these has opened doors for running complex programs written in “low-level assembly-like language” on web.
We are already seeing some interesting use cases of WebAssembly, Like TensorFlow has announced — WebAssembly backend for TensorFlow.js (more details here)
One more interesting example of WebAssembly could be — A WebAssembly Powered Augmented Reality Sudoku Solver.
You can find a brief tutorial that describes this project on my blog. This project makes use of the WebAssembly build…
In our example using WebAssembly NES emulator and run Super Mario Brothers and Tetris game in our web browser.
TL;DR Use docker image
$ docker pull bhargavshah86/rust-wasm-demo:1.0.0
$ docker run --name rust-wasm-demo -d -p 8080:80 bhargavshah86/rust-wasm-demo:1.0.0$ # http://localhost:8080/wasm_rust_demo.html
3. HTML and JS code to glue in all parts together
4. Open our “rust_wasm_demo.html” in browser.
WebAssembly brings the performance of native applications to the web in a way that’s completely secure, yet enabling a full functionality expected from games, major applications and the entire spectrum of software you can run on a computer. WebAssembly is just built as a binary format and very compact to download, and also very efficient to compile and execute. There’s a whole bunch of optimizations coming that will drive that even further, allowing huge applications to load up quickly, even on mobile devices.
Thank you for reading 😃
NES emulator written in Rust + WASM. Contribute to takahirox/nes-rust development by creating an account on GitHub.