Created
September 15, 2019 05:24
-
-
Save jeroen/13dde3c3f6fa1e8fde330df4135d548d to your computer and use it in GitHub Desktop.
wasm in R
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(V8) | |
ctx <- v8() | |
ctx$eval(" | |
let bytes = new Uint8Array([ | |
0x00, 0x61, 0x73, 0x6d, 0x01, 0x00, 0x00, 0x00, 0x01, 0x07, 0x01, | |
0x60, 0x02, 0x7f, 0x7f, 0x01, 0x7f, 0x03, 0x02, 0x01, 0x00, 0x07, | |
0x07, 0x01, 0x03, 0x61, 0x64, 0x64, 0x00, 0x00, 0x0a, 0x09, 0x01, | |
0x07, 0x00, 0x20, 0x00, 0x20, 0x01, 0x6a, 0x0b | |
]); | |
let module = new WebAssembly.Module(bytes); | |
let instance = new WebAssembly.Instance(module); | |
instance.exports.add(3, 4); | |
") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment