Learn R Programming

V8 (version 6.0.0)

wasm: Experimental WebAssembly

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

wasm(data)

wasm_features()

Arguments

data

either raw vector or file path with the binary wasm program

Details

The wasm_features() function uses the wasm-feature-detect JavaScript library to test which WASM capabilities are supported in the current version of libv8.

Examples

Run this code
# Load example wasm program
instance <- wasm(system.file('wasm/add.wasm', package = 'V8'))
instance$exports$add(12, 30)
wasm_features()

Run the code above in your browser using DataLab