Create and Run a Native WebAssembly Function

InstructorGuy Bedford

Share this video with your friends

Send Tweet

In this introduction, we show a simple WebAssembly function that returns the square root of a number. To create this function we load up WebAssembly Explorer (https://mbebenita.github.io/WasmExplorer/), writing the native WAST code to create and export the function. We compile and download the resulting WebAssembly binary, loading this with the Fetch API and WebAssembly JavaScript API to call the function in the browser.

Demo Repo: https://github.com/guybedford/wasm-intro

Brian
~ 7 years ago

Whoa it's Guy Bedford!

Zach Barnes
~ 7 years ago

Everything works fine when test.wasm is served, but when locally referenced, the test file is not able to be acquired.

Guy Bedfordinstructor
~ 7 years ago

Are you running a local server to serve the files? This is necessary for the loading to work.

Mateusz
~ 7 years ago
Feng Chen
~ 6 years ago