wasm | R Documentation |
Experimental wrapper to load a WebAssembly program. Returns a list of exported functions. This will probably be moved into it's own package once WebAssembly matures.
wasm(data)
wasm_features()
data |
either raw vector or file path with the binary wasm program |
The wasm_features()
function uses the wasm-feature-detect
JavaScript library to test which WASM capabilities are supported in the
current version of libv8.
# Load example wasm program
if(engine_info()$numeric_version > 6){
instance <- wasm(system.file('wasm/add.wasm', package = 'V8'))
instance$exports$add(12, 30)
}
wasm_features()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.