Skip to main content
100%

WebAssembly integer operations

✓ Published0🌍 Public
CColinEberhardt
Last edited Jan 16, 2018
Created on Jan 16, 2018

This example demonstrates a JavaScript WebAssembly module that exports integer division and echo functions, highlighting a discrepancy between WebAssembly’s spec-defined `ToWebAssemblyValue` coercion and its inverse `ToJSValue` conversion for i32 values. It uses the WebAssembly JavaScript API’s `instantiate` and `instance.exports` to call compiled wasm functions, while manually implementing the ECMA-262 `ToInt32` algorithm and a guessed JavaScript conversion. The visualization presents console output comparing wasm results against equivalent JavaScript conversions, revealing that unsigned division produces different values due to overflow handling.

AI-generated description

Built with blockbuilder.org

forked from <a href='http://bl.ocks.org/anonymous/'>anonymous</a>'s block: <a href='http://bl.ocks.org/anonymous/89f12f5c55a098377a1b378693330bb3'>WebAssembly integer operations</a>

mit Licensed

Similar vizzes