Skip to content

Instantly share code, notes, and snippets.

Forked from anonymous/
Created Nov 26, 2017
What would you like to do?
fn main() {}
pub fn add_one(x: i32) -> i32 {
x + 1
const fs = require('fs');
const buf = fs.readFileSync('./hello.wasm');
var m = new WebAssembly.Instance(new WebAssembly.Module(buf));
var h = new Uint8Array(m.exports.memory.buffer);
var p = m.exports.add_one(3);

This comment has been minimized.

Copy link
Owner Author

@mizchi mizchi commented Nov 26, 2017

$ rustc +nightly --target wasm32-unknown-unknown -O
$ node --expose-wasm run.js

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment