wasm: Experimental WebAssembly

Description Usage Arguments Examples

View source: R/wasm.R

Description

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.

Usage

1

Arguments

data

either raw vector or file path with the binary wasm program

Examples

1
2
3
4
5
# Load example wasm program
if(engine_info()$version > 6){
instance <- wasm(system.file('wasm/add.wasm', package = 'V8'))
instance$exports$add(12, 30)
}

Example output

Using V8 engine 3.14.5.9

V8 documentation built on Nov. 10, 2021, 9:08 a.m.