Skip to content

Instantly share code, notes, and snippets.

@goofmint

goofmint/index.js

Created Mar 19, 2019
Embed
What would you like to do?
const {wastInstructions} = require('inline-wast/lib/interpreter');
function add(a, b) {
const fn = wastInstructions`
(i32.const ${a})
(i32.const ${b})
(i32.add)
`;
return fn();
}
console.log(add(3, 1)); // 4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.