-
-
Notifications
You must be signed in to change notification settings - Fork 671
WebAssembly
Hajime Hoshi edited this page Jul 5, 2018
·
28 revisions
As there are differences between the latest Go and Go 1.11 beta, I recommend to use the latest Go here.
- Checkout the latest Go (https://go.googlesource.com/go)
- Compile the compiler by running
./make.bash
After that, use the compiled go
binary.
<!DOCTYPE html>
<script src="wasm_exec.js"></script>
<script>
// Polyfill
if (!WebAssembly.instantiateStreaming) {
WebAssembly.instantiateStreaming = async (resp, importObject) => {
const source = await (await resp).arrayBuffer();
return await WebAssembly.instantiate(source, importObject);
};
}
const go = new Go();
WebAssembly.instantiateStreaming(fetch("sprites.wasm"), go.importObject).then(result => {
go.run(result.instance);
});
</script>
TBD